Exemple #1
0
        private void InitSyntaxColoring()
        {
            // Configure the default style
            TextArea.StyleResetDefault();
            TextArea.Styles[ScintillaNET.Style.Default].Font      = "Consolas";
            TextArea.Styles[ScintillaNET.Style.Default].Size      = 10;
            TextArea.Styles[ScintillaNET.Style.Default].BackColor = IntToColor(0x212121);
            TextArea.Styles[ScintillaNET.Style.Default].ForeColor = IntToColor(0xFFFFFF);
            TextArea.StyleClearAll();

            // Configure the CPP (C#) lexer styles
            TextArea.Styles[ScintillaNET.Style.Cpp.Identifier].ForeColor             = IntToColor(0xD0DAE2);
            TextArea.Styles[ScintillaNET.Style.Cpp.Comment].ForeColor                = IntToColor(0x0ba728);
            TextArea.Styles[ScintillaNET.Style.Cpp.CommentLine].ForeColor            = IntToColor(0x40BF57);
            TextArea.Styles[ScintillaNET.Style.Cpp.CommentDoc].ForeColor             = IntToColor(0x2FAE35);
            TextArea.Styles[ScintillaNET.Style.Cpp.Number].ForeColor                 = IntToColor(0xFFFF00);
            TextArea.Styles[ScintillaNET.Style.Cpp.String].ForeColor                 = IntToColor(0x07E8DB);
            TextArea.Styles[ScintillaNET.Style.Cpp.Character].ForeColor              = IntToColor(0xE95454);
            TextArea.Styles[ScintillaNET.Style.Cpp.Preprocessor].ForeColor           = IntToColor(0x8AAFEE);
            TextArea.Styles[ScintillaNET.Style.Cpp.Operator].ForeColor               = IntToColor(0xE0E0E0);
            TextArea.Styles[ScintillaNET.Style.Cpp.Regex].ForeColor                  = IntToColor(0xff00ff);
            TextArea.Styles[ScintillaNET.Style.Cpp.CommentLineDoc].ForeColor         = IntToColor(0x77A7DB);
            TextArea.Styles[ScintillaNET.Style.Cpp.Word].ForeColor                   = IntToColor(0x48A8EE);
            TextArea.Styles[ScintillaNET.Style.Cpp.Word2].ForeColor                  = IntToColor(0xF98906);
            TextArea.Styles[ScintillaNET.Style.Cpp.CommentDocKeyword].ForeColor      = IntToColor(0xB3D991);
            TextArea.Styles[ScintillaNET.Style.Cpp.CommentDocKeywordError].ForeColor = IntToColor(0xFF0000);
            TextArea.Styles[ScintillaNET.Style.Cpp.GlobalClass].ForeColor            = IntToColor(0x48A8EE);

            TextArea.Lexer = ScintillaNET.Lexer.Cpp;

            TextArea.SetKeywords(0, "class extends implements import interface new case do while else if for in switch throw get set function var try catch finally while with default break continue delete return each const namespace package include use is as instanceof typeof author copy default deprecated eventType example exampleText exception haxe inheritDoc internal link mtasc mxmlc param private return see serial serialData serialField since throws usage version langversion playerversion productversion dynamic private public partial static intrinsic internal native override protected AS3 final super this arguments null Infinity NaN undefined true false abstract as base bool break by byte case catch char checked class const continue decimal default delegate do double descending explicit event extern else enum false finally fixed float for foreach from goto group if implicit in int interface internal into is lock long new null namespace object operator out override orderby params private protected public readonly ref return switch struct sbyte sealed short sizeof stackalloc static string select this throw true try typeof uint ulong unchecked unsafe ushort using var virtual volatile void while where yield");
            TextArea.SetKeywords(1, "void Null ArgumentError arguments Array Boolean Class Date DefinitionError Error EvalError Function int Math Namespace Number Object RangeError ReferenceError RegExp SecurityError String SyntaxError TypeError uint XML XMLList Boolean Byte Char DateTime Decimal Double Int16 Int32 Int64 IntPtr SByte Single UInt16 UInt32 UInt64 UIntPtr Void Path File System Windows Forms ScintillaNET");
        }
 public override void SetKeywords(ScintillaNET.Scintilla scintilla)
 {
     // Set keyword lists
     // Word = 0
     scintilla.SetKeywords(0, "go add alter as authorization backup begin bigint binary bit break " +
                           "browse bulk by cascade case catch check checkpoint close clustered " +
                           "column commit compute constraint containstable continue create current " +
                           "cursor cursor database date datetime datetime2 datetimeoffset dbcc " +
                           "deallocate decimal declare default delete deny desc disk distinct " +
                           "distributed double drop dump else end errlvl escape except exec execute " +
                           "exit external fetch file fillfactor float for foreign freetext freetexttable " +
                           "from full function goto grant group having hierarchyid holdlock identity " +
                           "identity_insert identitycol if image index insert int intersect into key kill " +
                           "lineno load merge money national nchar nocheck nocount nolock nonclustered " +
                           "ntext numeric nvarchar of off offsets on open opendatasource openquery " +
                           "openrowset openxml option order over percent plan precision primary print " +
                           "proc procedure public raiserror read readtext real reconfigure references " +
                           "replication restore restrict return revert revoke rollback rowcount " +
                           "rowguidcol rule save schema securityaudit select set setuser shutdown " +
                           "smalldatetime smallint smallmoney sql_variant statistics table " +
                           "tablesample text textsize then time timestamp tinyint to top tran " +
                           "transaction trigger truncate try union unique uniqueidentifier update " +
                           "updatetext use user values varbinary varchar varying view waitfor when " +
                           "where while with writetext xml " +
                           //Custom TPT
                           "define job operator type schema attributes varchar integer decimal character apply step to select from");
     // Word2 = 1
     scintilla.SetKeywords(1, "ascii cast char charindex ceiling coalesce collate contains convert " +
                           "current_date current_time current_timestamp current_user floor isnull " +
                           "max min nullif object_id session_user substring system_user tsequal ");
     // User1 = 4
     scintilla.SetKeywords(4, "all and any between cross exists in inner is join left like not null " +
                           "or outer pivot right some unpivot ( ) * " +
                           //Custom TPT
                           "update load odbc");
     // User2 = 5
     scintilla.SetKeywords(5, "sys objects sysobjects ");
 }