简体   繁体   English

是否可以在类摘要xml标记中使用ToString()值?

[英]Is it possible to use ToString() value in class summary xml tag?

Is it possible to use ToString() in summary xml tag? 是否可以在摘要xml标记中使用ToString()?

    /// <summary>
    /// I want to use the value from ToString() here.
    /// </summary>
    public class TheObject
    {
        public override string ToString()
        {
            return "Hellow World!";
        }
    }

No, this is not possible. 不,这是不可能的。

These are comments , not executable code. 这些是注释 ,而不是可执行代码。

You may be can do something like this using AOP (Aspect Oriented Programming). 可以使用AOP(面向方面​​编程)做这样的事情。

But as this ia bout a comments , I personally, don't see any sence of defining a "dynamic" comment like this (I suppose, if string changes, you would like that comment changes too). 但截至保险业监督回合的意见 ,我本人没有看到定义这样一个“动态”的评论(我想,如果字符串的变化,你会喜欢的意见变化太大)的任何培训就业处。 Comments has to be basic description of the functionality, without need of diging into the concrete implementation details and values of the code inside the artifact it describes. 注释必须是功能的基本描述,而无需深入了解其描述的工件内部代码的具体实现细节和值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM