示例#1
0
 public override UIDETokenDef GetKeywordTokenDef(UIDETokenDef tokenDef, string str)
 {
     if (CheckIfStringIsKeyword(str))
     {
         UIDETokenDef keywordTokenDef = UIDETokenDefs.Get("Word,Keyword");
         if (keywordTokenDef != null)
         {
             return(keywordTokenDef);
         }
     }
     else if (CheckIfStringIsModifier(str))
     {
         UIDETokenDef keywordTokenDef = UIDETokenDefs.Get("Word,Modifier");
         if (keywordTokenDef != null)
         {
             return(keywordTokenDef);
         }
     }
     else if (CheckIfStringIsPrimitiveType(str))
     {
         UIDETokenDef keywordTokenDef = UIDETokenDefs.Get("Word,PrimitiveType");
         if (keywordTokenDef != null)
         {
             return(keywordTokenDef);
         }
     }
     return(tokenDef);
 }
示例#2
0
        public override void InitializeTokenDefs()
        {
            UIDETokenDefs.tokenDefsHash = new UIDEHashTable();

            UIDETokenDefs.AddNew("DefaultText", new Color(0.85f, 0.85f, 0.85f, 1), new Color(1, 1, 1, 0));

            UIDETokenDefs.AddNew("PreProcess", new Color(0.6f, 0.6f, 1.0f, 1), new Color(1, 1, 1, 0), 1.0f, true);
            UIDETokenDefs.Get("PreProcess").isActualCode = false;

            UIDETokenDefs.AddNew("String", new Color(1.0f, 0.85f, 0.2f, 1), new Color(1.0f, 0.95f, 0.4f, 0.25f), 1.25f, true);
            UIDETokenDefs.Get("String").useParsableString = true;
            UIDETokenDefs.Get("String").parsableString    = "new System.String()";
            UIDETokenDefs.Get("String").isActualCode      = false;

            UIDETokenDefs.AddNew("String,CharString", new Color(1.0f, 0.85f, 0.2f, 1), new Color(1.0f, 0.95f, 0.4f, 0.25f), 1.25f, true);
            UIDETokenDefs.Get("String,CharString").useParsableString = true;
            UIDETokenDefs.Get("String,CharString").parsableString    = "new System.Char()";
            UIDETokenDefs.Get("String,CharString").isActualCode      = false;

            UIDETokenDefs.AddNew("Comment,SingleLine", new Color(0.5f, 0.5f, 0.5f, 1), new Color(1, 1, 1, 0.25f));
            UIDETokenDefs.AddNew("Comment,Block,Contained", new Color(0.5f, 0.5f, 0.5f, 1), new Color(1, 1, 1, 0.25f));
            UIDETokenDefs.AddNew("Comment,Block,Start", new Color(0.5f, 0.5f, 0.5f, 1), new Color(1, 1, 1, 0.25f));
            UIDETokenDefs.AddNew("Comment,Block,End", new Color(0.5f, 0.5f, 0.5f, 1), new Color(1, 1, 1, 0.25f));
            UIDETokenDefs.Get("Comment,SingleLine").isActualCode      = false;
            UIDETokenDefs.Get("Comment,Block,Contained").isActualCode = false;
            UIDETokenDefs.Get("Comment,Block,Start").isActualCode     = false;
            UIDETokenDefs.Get("Comment,Block,End").isActualCode       = false;

            UIDETokenDefs.AddNew("Number,Double", new Color(1.0f, 0.5f, 0.35f, 1), new Color(1.0f, 0.75f, 0.5f, 0.25f), 1.25f, true);
            UIDETokenDefs.Get("Number,Double").useParsableString = true;
            UIDETokenDefs.Get("Number,Double").parsableString    = "new System.Double()";

            UIDETokenDefs.AddNew("Number,Float", new Color(1.0f, 0.5f, 0.35f, 1), new Color(1.0f, 0.75f, 0.5f, 0.25f), 1.25f, true);
            UIDETokenDefs.Get("Number,Float").useParsableString = true;
            UIDETokenDefs.Get("Number,Float").parsableString    = "new System.Single()";

            UIDETokenDefs.AddNew("Number,Int64", new Color(1.0f, 0.5f, 0.35f, 1), new Color(1.0f, 0.75f, 0.5f, 0.25f), 1.25f, true);
            UIDETokenDefs.Get("Number,Int64").useParsableString = true;
            UIDETokenDefs.Get("Number,Int64").parsableString    = "new System.Int64()";

            UIDETokenDefs.AddNew("Number,Int32", new Color(1.0f, 0.5f, 0.35f, 1), new Color(1.0f, 0.75f, 0.5f, 0.25f), 1.25f, true);
            UIDETokenDefs.Get("Number,Int32").useParsableString = true;
            UIDETokenDefs.Get("Number,Int32").parsableString    = "new System.Int32()";

            UIDETokenDefs.AddNew("Number", new Color(1.0f, 0.5f, 0.35f, 1), new Color(1.0f, 0.75f, 0.5f, 0.25f), 1.25f, true);
            UIDETokenDefs.Get("Number").useParsableString = true;
            UIDETokenDefs.Get("Number").parsableString    = "new System.Int32()";

            UIDETokenDefs.AddNew("Word", new Color(0.85f, 0.85f, 0.85f, 1), new Color(1, 1, 1, 0.0f), 1.25f, true);
            UIDETokenDefs.AddNew("Word,Keyword", new Color(1.0f, 1.0f, 1.0f, 1), new Color(1, 1, 1, 0.0f), 1.25f, true);
            UIDETokenDefs.AddNew("Word,Modifier", new Color(0.75f, 0.5f, 0.6f, 1), new Color(1, 1, 1, 0.0f), 1.25f, true);
            UIDETokenDefs.AddNew("Word,PrimitiveType", new Color(0.65f, 0.75f, 0.5f, 1), new Color(1, 1, 1, 0.0f), 1.25f, true);
            UIDETokenDefs.AddNew("Word,APIToken,Type", new Color(0.65f, 0.75f, 0.5f, 1), new Color(1, 1, 1, 0.0f), 1.25f, true);
            //UIDETokenDefs.AddNew("Word,APIToken,Type",new Color(0.7f,0.9f,0.6f,1),new Color(1,1,1,0.0f),1.25f,true);

            UIDETokenDefs.AddNew("WhiteSpace", new Color(1, 1, 1, 0), new Color(1, 1, 1, 0));
            UIDETokenDefs.AddNew("WhiteSpace,Tab", new Color(1, 1, 1, 0), new Color(1, 1, 1, 0.0f));

            UIDETokenDefs.AddNew("LineEnd", new Color(1.0f, 1.0f, 1.0f, 1), new Color(1, 1, 1, 0), 1.0f, true);
            UIDETokenDefs.AddNew("Dot", new Color(1.0f, 1.0f, 1.0f, 1), new Color(1, 1, 1, 0), 1.0f, true);

            editor.textSettings.UpdateTokenDefBoldStates();
        }