public JavaScriptEditor() : base() { // FontFamily = "{Binding Source={x:Static settings:Settings.Default}, Path=SourceFont}" // var fontFamilyBinding = new Binding("SourceFont"); //fontFamilyBinding.Source = Properties.Settings.Default; //this.SetBinding(FontFamilyProperty, fontFamilyBinding); // Configure the X++ folding manager. // The indentation strategy is probably not needed since the view is readonly... this.TextArea.IndentationStrategy = new ICSharpCode.AvalonEdit.Indentation.CSharp.CSharpIndentationStrategy(this.Options); var xppFoldingStrategy = new BraceFoldingStrategy(); var xppFoldingManager = FoldingManager.Install(this.TextArea); xppFoldingStrategy.UpdateFoldings(xppFoldingManager, this.Document); //using (var stream = Assembly.GetAssembly(typeof(ICSharpCode.AvalonEdit.TextEditor)).GetManifestResourceStream("ICSharpCode.AvalonEdit.Highlighting.Resources.JavaScript-Mode.xshd")) //{ // using (var reader = new XmlTextReader(stream)) // { // this.SyntaxHighlighting = HighlightingLoader.Load(reader, HighlightingManager.Instance); // SearchPanel.Install(this); // } //} this.SyntaxHighlighting = LoadHighlightDefinition("ICSharpCode.AvalonEdit.Highlighting.Resources.JavaScript-Mode.xshd", Assembly.GetAssembly(typeof(ICSharpCode.AvalonEdit.TextEditor))); }
public XppSourceEditor(Model model) : base(model) { // FontFamily = "{Binding Source={x:Static settings:Settings.Default}, Path=SourceFont}" var fontFamilyBinding = new Binding("SourceFont") { Source = Properties.Settings.Default }; this.SetBinding(FontFamilyProperty, fontFamilyBinding); // Configure the X++ folding manager. // The indentation strategy is probably not needed since the view is readonly... this.TextArea.IndentationStrategy = new ICSharpCode.AvalonEdit.Indentation.CSharp.CSharpIndentationStrategy(this.Options); var xppFoldingStrategy = new BraceFoldingStrategy(); var xppFoldingManager = FoldingManager.Install(this.TextArea); xppFoldingStrategy.UpdateFoldings(xppFoldingManager, this.Document); this.IsReadOnly = true; this.SyntaxHighlighting = LoadHighlightDefinition("SocratexGraphExplorer.Resources.Xpp-Mode.xshd"); }