public IDEView() { InitializeComponent(); inst_ = this; gridSearch.DataContext = this; Activity.IDBBuilderActivity.BuildIntellisenseDatabase(); }
public void PushOutput(string text) { IDEView.inst().Dispatcher.Invoke(delegate() { CompilerOutput += text; }); }
public void PublishError(PluginLib.CompileError error) { IDEView.inst().Dispatcher.Invoke(delegate() { CompileErrors.Add(error); }); }
public void PublishWarning(PluginLib.CompileError error) { IDEView.inst().Dispatcher.Invoke(delegate() { CompileErrors.Add(error); OnPropertyChanged("CompileErrorCt"); OnPropertyChanged("CompileWarningCt"); }); }
public IDEView() { InitializeComponent(); inst_ = this; gridSearch.DataContext = this; Activity.IDBBuilderActivity.BuildIntellisenseDatabase(); foreach (PluginLib.ISearchService searchService in PluginManager.inst().SearchServices.OrderBy(l => l.Name)) comboSearchType.Items.Add(searchService.Name); comboSearchType.SelectedIndex = 0; }
public IDEView() { InitializeComponent(); inst_ = this; gridSearch.DataContext = this; Activity.IDBBuilderActivity.BuildIntellisenseDatabase(); foreach (PluginLib.ISearchService searchService in PluginManager.inst().SearchServices.OrderBy(l => l.Name)) { comboSearchType.Items.Add(searchService.Name); } comboSearchType.SelectedIndex = 0; }
public IDEEditor(FileBaseItem aItem) { InitializeComponent(); item = aItem; changeChecker = new DataChanged { editor = editor }; SetCode(aItem); editor.ShowLineNumbers = true; if (aItem.Name.EndsWith(".as")) { editor.SyntaxHighlighting = LoadHighlightingDefinition("Debugger.Resources.Angelscript.xshd"); } else if (aItem.Name.EndsWith(".xml")) { editor.SyntaxHighlighting = LoadHighlightingDefinition("Debugger.Resources.XML.xshd"); } else { editor.SyntaxHighlighting = ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.Instance.GetDefinitionByExtension(item.Path.Substring(item.Path.LastIndexOf('.'))); } editor.FontFamily = new FontFamily("Consolas"); editor.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFDCDCCC")); editor.TextArea.TextView.BackgroundRenderers.Add(new LineHighlighter()); editor.TextArea.TextView.BackgroundRenderers.Add(new ErrorLineHighlighter(aItem)); Debugger.Editor.SearchPanel.Install(editor); editor.TextChanged += editor_TextChanged; scanner = new DepthScanner(); scanner.Process(editor.Text); editor.MouseHover += editor_MouseHover; editor.KeyUp += editor_KeyUp; editor.ContextMenu = new ContextMenu(); editor.ContextMenu.Items.Add(new MenuItem { Header = "Compile", Command = new RelayCommand(p => { IDEView.Compile(); }) }); editor.ContextMenu.Items.Add(new Separator()); editor.ContextMenu.Items.Add(new MenuItem { Header = "New ScriptObject", Command = new RelayCommand(p => { editor.Document.BeginUpdate(); editor.Document.Insert(editor.CaretOffset, SOScript); editor.Document.EndUpdate(); }) }); editor.ContextMenu.Items.Add(new MenuItem { Header = "Insert #include", Command = new RelayCommand(p => { Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); dlg.DefaultExt = "*"; dlg.Filter = "All files (*.*)|*.*"; if (dlg.ShowDialog() == true) { editor.Document.BeginUpdate(); editor.Document.Insert(editor.CaretOffset, string.Format("#include \"{0}\"", dlg.FileName)); editor.Document.EndUpdate(); } }) }); editor.ContextMenu.Items.Add(new MenuItem { Header = "Doxygen Comment", Command = new RelayCommand(p => { editor.Document.BeginUpdate(); editor.Document.Insert(editor.CaretOffset, @"///////////////////////////////////////////////// /// DOCUMENT_HERE /////////////////////////////////////////////////", AnchorMovementType.AfterInsertion); editor.Document.EndUpdate(); }) }); editor.ContextMenu.Items.Add(new MenuItem { Header = "Property Comment", Command = new RelayCommand(p => { editor.Document.BeginUpdate(); editor.Document.Insert(editor.CaretOffset, "///< DOCUMENT", AnchorMovementType.AfterInsertion); editor.Document.EndUpdate(); }) }); editor.ContextMenu.Items.Add(new MenuItem { Header = "Snippet", Command = new RelayCommand(p => { ObservableCollection <Snippets.CodeSnippet> snips = new ObservableCollection <Snippets.CodeSnippet>(); string ext = System.IO.Path.GetExtension(item.Path); foreach (Snippets.CodeSnippet snip in Snippets.SnippetData.inst().Snippets) { if (snip.Extension.Equals(ext)) { snips.Add(snip); } } if (snips.Count > 0) { Snippets.SnippetDlg dlg = new Snippets.SnippetDlg(editor, snips); dlg.ShowDialog(); } }, sp => { ObservableCollection <Snippets.CodeSnippet> snips = new ObservableCollection <Snippets.CodeSnippet>(); string exte = System.IO.Path.GetExtension(item.Path); foreach (Snippets.CodeSnippet snip in Snippets.SnippetData.inst().Snippets) { if (snip.Extension.Equals(exte)) { return(true); } } return(false); }) }); editor.ContextMenu.Items.Add(new Separator()); editor.ContextMenu.Items.Add(new MenuItem { Header = "Cut", Command = ApplicationCommands.Cut }); editor.ContextMenu.Items.Add(new MenuItem { Header = "Copy", Command = ApplicationCommands.Copy }); editor.ContextMenu.Items.Add(new MenuItem { Header = "Paste", Command = ApplicationCommands.Paste }); editor.ContextMenu.Items.Add(new Separator()); editor.ContextMenu.Items.Add(new MenuItem { Header = "Undo", Command = ApplicationCommands.Undo }); editor.ContextMenu.Items.Add(new MenuItem { Header = "Redo", Command = ApplicationCommands.Redo }); editor.ContextMenu.Items.Add(new Separator()); editor.ContextMenu.Items.Add(new MenuItem { Header = "Save", Command = ApplicationCommands.Save }); editor.ContextMenu.Items.Add(new Separator()); editor.ContextMenu.Items.Add(new MenuItem { Header = "Save As", Command = ApplicationCommands.SaveAs }); editor.ContextMenu.Items.Add(new Separator()); editor.ContextMenu.Items.Add(new MenuItem { Header = "Open", Command = ApplicationCommands.Open }); }