Example #1
0
        //view menu handlers (the remaining is define in toolbar section)
        private void SetCodeLanguage(object sender, EventArgs e)
        {
            MenuItem m = (MenuItem)(sender);

            if (MDockArea.ActiveDocument.GetType().Equals(typeof(CodeEditor)))
            {
                CodeEditor ce = (CodeEditor)MDockArea.ActiveDocument;
                foreach (MenuItem item in MLanguage.MenuItems)
                {
                    item.Checked = false;
                }
                //change brunch
                Dictionary <string, string> dic = MOO_BRUNCH_BROWSER.GetBrunchDictionary(m.Text);
                ce.UpdateSnippets(dic);
                ce.SetLanguage(m.Tag.ToString());
                m.Checked = true;
            }
        }
Example #2
0
        private CodeEditor CreateEditor(string filename, string filetype)
        {
            string     lexer = SupportedFiles.GetLexer(filetype);
            CodeEditor ce    = new CodeEditor(MOO_APPLICATION_SETTINGS.EditorConfig, filename);

            ce.SetLanguage(lexer);
            //get keywordlist from current project
            if (MOO_APPLICATION_SETTINGS.CurrentProject != null)
            {
                ce.UpadateCompletionList(MOO_APPLICATION_SETTINGS.CurrentProject.GetKeywords());
            }
            //add brunchs to editor list
            Dictionary <string, string> dic = MOO_BRUNCH_BROWSER.GetBrunchDictionary(filetype);

            ce.UpdateSnippets(dic);

            ce.CaretPositionChanged += new CaretPositionHandler(UpdateSatutsLineColumn);
            return(ce);
        }
Example #3
0
        private CodeEditor CreateEditor(string filename,string filetype)
        {
            string lexer = SupportedFiles.GetLexer(filetype);
            CodeEditor ce = new CodeEditor(MOO_APPLICATION_SETTINGS.EditorConfig, filename);
            ce.SetLanguage(lexer);
            //get keywordlist from current project
            if (MOO_APPLICATION_SETTINGS.CurrentProject != null) {
                ce.UpadateCompletionList(MOO_APPLICATION_SETTINGS.CurrentProject.GetKeywords());
            }
            //add brunchs to editor list
            Dictionary<string,string> dic= MOO_BRUNCH_BROWSER.GetBrunchDictionary(filetype);
            ce.UpdateSnippets(dic);

            ce.CaretPositionChanged += new CaretPositionHandler(UpdateSatutsLineColumn);
            return ce;
        }