StonehearthEditor.FilePreview.configureScintilla C# (CSharp) Method

configureScintilla() private method

Sets up some more things about textBox.
private configureScintilla ( ) : void
return void
        private void configureScintilla()
        {
            // Make sure we start proper
            textBox.SetSavePoint();
            textBox.EmptyUndoBuffer();

            // Set the default style
            textBox.StyleResetDefault();
            textBox.Styles[Style.Default].Font = "Consolas";
            textBox.Styles[Style.Default].Size = 10;
            textBox.Styles[Style.Default].ForeColor = Color.Black;
            textBox.Margins[0].Width = 16;
            textBox.StyleClearAll();

            // Based on the extension, we need to choose the right lexer/style
            switch (System.IO.Path.GetExtension(mFileData.Path))
            {
                case ".lua":
                case ".luac":
                    this.configureLuaHighlighting();
                    break;
                case ".js":
                case ".json":
                    this.configureJsonHighlighting();
                    break;
                case ".css":
                case ".less":
                    textBox.Lexer = ScintillaNET.Lexer.Css;
                    break;
                case ".html":
                case ".htm":
                    textBox.Lexer = ScintillaNET.Lexer.Html;
                    break;
                case ".md":
                    textBox.Lexer = ScintillaNET.Lexer.Markdown;
                    break;
                case ".xml":
                    textBox.Lexer = ScintillaNET.Lexer.Xml;
                    break;
            }

            this.textBox.Styles[Style.CallTip].SizeF = 8.25f;
            this.textBox.Styles[Style.CallTip].ForeColor = Color.Black;
            this.textBox.Styles[Style.CallTip].BackColor = Color.White;
            this.textBox.Styles[Style.CallTip].Font = "Verdana";
            this.textBox.Styles[Style.CallTip].Hotspot = true;

            this.textBox.TextChanged += (sender, e) => this.restyleDocument();
            this.restyleDocument();
        }