protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); string bp = System.IO.Path.GetDirectoryName(Assembly.GetAssembly(typeof(MainWindow)).Location); _completion = new ICSharpCode.CodeCompletion.CSharpCompletion(); _completion.AddAssembly(Assembly.GetAssembly(typeof(MainWindow)).Location); _completion.AddAssembly(System.IO.Path.Combine(bp, "NPoco.dll")); _completion.AddAssembly(System.IO.Path.Combine(bp, "NPOI.dll")); _completion.AddAssembly(System.IO.Path.Combine(bp, "NPOI.OOXML.dll")); _completion.AddAssembly(System.IO.Path.Combine(bp, "NPOI.OpenXml4Net.dll")); _completion.AddAssembly(System.IO.Path.Combine(bp, "NPOI.OpenXmlFormats.dll")); _completion.AddAssembly(System.IO.Path.Combine(bp, "ICSharpCode.SharpZipLib.dll")); var allscripts = Settings.Settings.Default.GetScriptItems(); foreach (var scr in allscripts) { addScriptToTreeView(scr); } }
private void PrepareTextEditor() { codeCompletion = new ICSharpCode.CodeCompletion.CSharpCompletion(); codeCompletion.AddAssembly( "UOMachine.exe" ); scriptTextBox.Completion = codeCompletion; scriptTextBox.FontFamily = new FontFamily( "Consolas" ); scriptTextBox.FontSize = 12; scriptTextBox.TextArea.DefaultInputHandler.NestedInputHandlers.Add( new SearchInputHandler( scriptTextBox.TextArea ) ); FileNew_Click( null, null ); scriptTextBox.SyntaxHighlighting = HighlightingManager.Instance.GetDefinition( "C#" ); scriptTextBox.Options = myCurrentOptions.TextEditorOptions; foldingManager = FoldingManager.Install( scriptTextBox.TextArea ); new BraceFoldingStrategy().UpdateFoldings( foldingManager, scriptTextBox.Document ); }