public void RecomputeComponents() { this.Components.Clear(); string renderText = this.FileReference.SortKey; int offset = (HighlightSubstring.Length == 0) ? -1 : renderText.IndexOf(HighlightSubstring, StringComparison.OrdinalIgnoreCase); while (offset >= 0) { AddSegment(renderText.Substring(0, offset), highlight: false); AddSegment(renderText.Substring(offset, HighlightSubstring.Length), highlight: true); renderText = renderText.Substring(offset + HighlightSubstring.Length); offset = renderText.IndexOf(HighlightSubstring, StringComparison.OrdinalIgnoreCase); } if (renderText.Length > 0) { AddSegment(renderText, highlight: false); } ComponentsChanged?.Invoke(this, EventArgs.Empty); }
public void RemoveComponent <T>() where T : IComponent { components.Remove(typeof(T)); ComponentsChanged?.Invoke(this, EventArgs.Empty); }
public void AddComponent(IComponent component) { components[component.GetType()] = component; ComponentsChanged?.Invoke(this, EventArgs.Empty); }