With a method like this:
#region _DESCRIPTION_ [Author("A")] [City("B")] [Year("2009")] #endregion void Method() { }
I'd like _DESCRIPTION_
to reflect the value of the Author
method attribute.
Any ideas on how I could implement this? The reason is that I have many attributes, some are long, so 开发者_StackOverflowI contain them within a region. I'd like the region description to reflect the value of one attribute in particular, automatically (otherwise I need to remember to update both each time).
I'm using VS 2010. Thanks.
I don't think this is doable at language level. #region is a preprocessor directive in C#, and C# spec does not offer this.
VisualStudio 2010 already implemented a feature that when you mouse over a collapsed block, it will show the first several lines of that block. Otherwise the only way maybe just do this
#region [Author("A")]
精彩评论