public override void Assign(RepositoryItem item) { BeginUpdate(); try { base.Assign(item); RepositoryItemMyTextEdit source = item as RepositoryItemMyTextEdit; if (source == null) { return; } IncrementalBackColor = source.IncrementalBackColor; IncrementalForeColor = source.IncrementalForeColor; } finally { EndUpdate(); } }
protected override void DrawMatchedString(ControlGraphicsInfoArgs info, Rectangle bounds, string text, string matchedText, AppearanceObject appearance, bool invert, int containsIndex) { TextEditViewInfo vi = info.ViewInfo as TextEditViewInfo; if (matchedText.Length > text.Length) { matchedText = text; } RepositoryItemMyTextEdit properties = (RepositoryItemMyTextEdit)vi.Item; AppearanceDefault highlight = new AppearanceDefault(properties.IncrementalForeColor, properties.IncrementalBackColor); info.Cache.Paint.DrawMultiColorString(info.Cache, bounds, text, matchedText, appearance, appearance.GetTextOptions().GetStringFormat(info.ViewInfo.DefaultTextOptions), highlight.ForeColor, highlight.BackColor, invert, containsIndex); }
static MyTextEdit() { RepositoryItemMyTextEdit.RegisterMyTextEdit(); }