/// <summary> /// Method to execute edit control loaded /// </summary> /// <param name="obj">Specifies the object parameter</param> private void ExecuteEditLoaded(object obj) { PythonLanguage customLanguage = new PythonLanguage(obj as EditControl); customLanguage.Lexem = Application.Current.MainWindow.Resources["pythonLanguageLexems"] as LexemCollection; customLanguage.Formats = Application.Current.MainWindow.Resources["pythonLanguageFormats"] as FormatsCollection; (obj as EditControl).CustomLanguage = customLanguage; }
/// <summary> /// Window Constructor and events initialization /// </summary> public Window1() { InitializeComponent(); Edit1.DocumentLanguage = Languages.Custom; Edit1.DocumentSource = "../../Source.py"; PythonLanguage customLanguage = new PythonLanguage(Edit1); customLanguage.Lexem = this.Resources["pythonLanguageLexems"] as LexemCollection; customLanguage.Formats = this.Resources["pythonLanguageFormats"] as FormatsCollection; Edit1.CustomLanguage = customLanguage; fontlst.SelectedItem = new FontFamily("Verdana"); }