protected override void OnContentChanged(NomadTextBox.Position oldRef, NomadTextBox.Position newRef) { base.UpdatePosition(ref this.m_codeHelperRange.start, oldRef, newRef); base.UpdatePosition(ref this.m_codeHelperRange.end, oldRef, newRef); base.OnContentChanged(oldRef, newRef); }
protected override void DrawTextFormat(Graphics g, IntPtr hFont, NomadTextBox.Position position, int x, int y, string s) { Color color = this.ForeColor; int i; int num; for (i = 0; i < s.Length; i = num) { i = base.SkipSpaceEnd(s, i); string token = this.GetToken(s, i); if (token == null) { break; } num = i + token.Length; if (token == "--") { x += base.DrawText(g, hFont, position, x, y, s.Substring(position.column, i - position.column), color); color = Color.Green; position.column = i; i = s.Length; break; } Color color2; if (NomadCodeBox.s_keywords.ContainsKey(token)) { color2 = Color.Blue; } else { if (NomadCodeBox.s_functions.ContainsKey(token)) { color2 = Color.Maroon; } else { color2 = this.ForeColor; } } if (color != color2) { x += base.DrawText(g, hFont, position, x, y, s.Substring(position.column, i - position.column), color); color = color2; position.column = i; } } x += base.DrawText(g, hFont, position, x, y, s.Substring(position.column, i - position.column), color); }