internal bool ShouldColorize(LanguageElement element) { if (element == null) { return(false); } if (!Colorizer_Options.ElementIsEnabled(this.ElementDescription)) { return(false); } if (element.ElementType == LanguageElementType.ElementReferenceExpression) { return(CheckReference(element)); } return((!(element is IMemberElement) || (element is IMemberElement && Visibilities.Contains(((IMemberElement)element).Visibility))) && Types.Contains(element.ElementType) && (Predicate == null || Predicate(element))); }
private void BuildElementCache() { _paintableElements.Clear(); if (!Colorizer_Options.IsEnabled()) { return; } _paintableElements.AddRange( from element in CodeRush.Source.ActiveFileNode.GetSourceFile().AllChildren() let option = _elements.FirstOrDefault(e => e.ShouldColorize(element)) where !option.Equals(default(ElementOptions)) select new ElementColors { Color = Colorizer_Options.GetColorFor(option.ElementDescription), Element = element }); }