Пример #1
0
        /// <summary>
        /// 
        /// </summary>
        public Interpreter()
        {
            // initialize parser objects
              scanner = new Scanner();
              parser = new Parser(scanner);
              //highlighter = new TextHighlighter(richTextBox, scanner, parser);

              // read configuration file and item files now
              readConfiguration();
                FunkyTownRunPlugin.DBLog.InfoFormat(" _______________________________________");
                FunkyTownRunPlugin.DBLog.InfoFormat(" ___-|: Darkfriend's Item Rules 2 :|-___");
                FunkyTownRunPlugin.DBLog.InfoFormat(" ___________________Rel.-v {0}_______", version);
        }
Пример #2
0
        public TextHighlighter(RichTextBox textbox, Scanner scanner, Parser parser)
        {
            Textbox = textbox;
            Scanner = scanner;
            Parser = parser;

            ClearUndo();

            //Tree = Parser.Parse(Textbox.Text);
            Textbox.TextChanged += new EventHandler(Textbox_TextChanged);
            textbox.KeyDown += new KeyEventHandler(textbox_KeyDown);
            Textbox.SelectionChanged += new EventHandler(Textbox_SelectionChanged);
            Textbox.Disposed += new EventHandler(Textbox_Disposed);

            SwitchContext = null;
            currentContext = Tree;

            threadAutoHighlight = new Thread(AutoHighlightStart)
            {
                Name = "Text Highlighter",
                IsBackground = true
            };
            threadAutoHighlight.Start();
        }