简体   繁体   中英

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

Is it possible to use ToString() in summary xml tag?

    /// <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).

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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