Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <c>LuatSyntaxLanguage</c> class.
        /// </summary>
        public LuatSyntaxLanguage(LuaIntellisenseBroker plugin)
            : base("Luat")
        {
            m_plugin = plugin;

            ExampleText = @"/*
                            function HelloWorld()
                              local a = 1
                              local b : FwVector4;
                            end";

            // Initialize highlighting styles (same as the LuaDefinition.xml values); helps SkinService
            HighlightingStyles.Add(new HighlightingStyle(ReservedWordStyleString, null, Color.Blue, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(FunctionStyleString, null, Color.Magenta, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(GlobalVariableStyleString, null, Color.Teal, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(OperatorStyleString, null, Color.Black, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(NumberStyleString, null, Color.Purple, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(StringDelimiterStyleString, null, Color.Maroon, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(StringDefaultStyleString, null, Color.Maroon, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(CommentDelimiterStyleString, null, Color.Green, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(CommentUrlStyleString, null, Color.Green, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(CommentTagStyleString, null, Color.Gray, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(CommentDefaultStyleString, null, Color.Green, Color.Empty));
            
            // Initialize custom highlighting styles
            HighlightingStyles.Add(new HighlightingStyle(WarningStyleString, null, Color.Green, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(ReferenceStyleString, null, Color.Empty, Color.LightCyan));
            HighlightingStyles.Add(new HighlightingStyle(AssignmentStyleString, null, Color.Empty, Color.MistyRose));

            // Initialize lexical states
            LexicalStates.Add(new DefaultLexicalState(LuatLexicalStateId.Default, "DefaultState"));
            DefaultLexicalState = LexicalStates["DefaultState"];
            LexicalStates["DefaultState"].DefaultHighlightingStyle = HighlightingStyles["DefaultStyle"];
        }
        /// <summary>
        /// Initializes a new instance of the <c>LuatSyntaxLanguage</c> class.
        /// </summary>
        public LuatSyntaxLanguage(LuaIntellisenseBroker plugin)
            : base("Luat")
        {
            m_plugin = plugin;

            ExampleText = @"/*
                            function HelloWorld()
                              local a = 1
                              local b : FwVector4;
                            end";

            // Initialize highlighting styles (same as the LuaDefinition.xml values); helps SkinService
            HighlightingStyles.Add(new HighlightingStyle(ReservedWordStyleString, null, Color.Blue, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(FunctionStyleString, null, Color.Magenta, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(GlobalVariableStyleString, null, Color.Teal, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(OperatorStyleString, null, Color.Black, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(NumberStyleString, null, Color.Purple, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(StringDelimiterStyleString, null, Color.Maroon, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(StringDefaultStyleString, null, Color.Maroon, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(CommentDelimiterStyleString, null, Color.Green, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(CommentUrlStyleString, null, Color.Green, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(CommentTagStyleString, null, Color.Gray, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(CommentDefaultStyleString, null, Color.Green, Color.Empty));

            // Initialize custom highlighting styles
            HighlightingStyles.Add(new HighlightingStyle(WarningStyleString, null, Color.Green, Color.Empty));
            HighlightingStyles.Add(new HighlightingStyle(ReferenceStyleString, null, Color.Empty, Color.LightCyan));
            HighlightingStyles.Add(new HighlightingStyle(AssignmentStyleString, null, Color.Empty, Color.MistyRose));

            // Initialize lexical states
            LexicalStates.Add(new DefaultLexicalState(LuatLexicalStateId.Default, "DefaultState"));
            DefaultLexicalState = LexicalStates["DefaultState"];
            LexicalStates["DefaultState"].DefaultHighlightingStyle = HighlightingStyles["DefaultStyle"];
        }
Beispiel #3
0
        public NavigationBar()
        {
            DropDownStyle = ComboBoxStyle.DropDownList;
            Sorted        = true;

            m_broker = LuaIntellisenseBroker.Get();

            SkinService.ApplyActiveSkin(this);
            SkinService.SkinChangedOrApplied += SkinServiceSkinChangedOrApplied;
        }
Beispiel #4
0
 internal static LuaIntellisenseBroker Create()
 {
     return s_instance ?? (s_instance = new LuaIntellisenseBroker());
 }
 internal static LuaIntellisenseBroker Create()
 {
     return(s_instance ?? (s_instance = new LuaIntellisenseBroker()));
 }