void EventNexus_DecorateLanguageElement(object sender, DecorateLanguageElementEventArgs args) { //Debug.WriteLine("EventNexus_DecorateLanguageElement"); var settings = DrawLinesBetweenMethodsSettings.Current; if (!settings.Enabled) return; LanguageElement langElement = args.LanguageElement; //CodeRush.Documents.ActiveTextDocument.ge if ((langElement is Class) && settings.EnableOnClass || (langElement is Property) && settings.EnableOnProperty || (langElement is Method) && settings.EnableOnMethod || (langElement is Enumeration) && settings.EnableOnEnum) { //Debug.WriteLine("langElement: " + langElement); // Skip up over Comment, AttributeSection, XmlDocComment var commentsAndStuff = previousSiblings(langElement) .TakeWhile(sibling => sibling is Comment || sibling is XmlDocComment || sibling is AttributeSection); langElement = commentsAndStuff.LastOrDefault() ?? langElement; //Debug.WriteLine(" > AddBackgroundAdornment ..."); var adornment = new HorizontalLineDocAdornment(langElement); args.AddBackgroundAdornment(adornment); } }
void EventNexus_DecorateLanguageElement(object sender, DecorateLanguageElementEventArgs args) { //Debug.WriteLine("EventNexus_DecorateLanguageElement"); var settings = DrawLinesBetweenMethodsSettings.Current; if (!settings.Enabled) { return; } LanguageElement langElement = args.LanguageElement; //CodeRush.Documents.ActiveTextDocument.ge if ((langElement is Class) && settings.EnableOnClass || (langElement is Property) && settings.EnableOnProperty || (langElement is Method) && settings.EnableOnMethod || (langElement is Enumeration) && settings.EnableOnEnum) { //Debug.WriteLine("langElement: " + langElement); // Skip up over Comment, AttributeSection, XmlDocComment var commentsAndStuff = previousSiblings(langElement) .TakeWhile(sibling => sibling is Comment || sibling is XmlDocComment || sibling is AttributeSection); langElement = commentsAndStuff.LastOrDefault() ?? langElement; //Debug.WriteLine(" > AddBackgroundAdornment ..."); var adornment = new HorizontalLineDocAdornment(langElement); args.AddBackgroundAdornment(adornment); } }