diff options
author | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-20 19:07:51 +0300 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-20 19:07:51 +0300 |
commit | 95408b1a41b31b645f3a8c3323ab7d3ca4bff26b (patch) | |
tree | f8f137cddcb9a40499d303be95722fd2c6081bce /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs | |
parent | b70e4e04b4e41b8ec28d7e4b220b401ecf467e7a (diff) | |
parent | de043d330a8bf5855d4d983c804cd36727cb2406 (diff) |
Merge remote-tracking branch 'origin/roslyn' into new-project-model
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs index f259dfdf67..a454de6047 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs @@ -31,6 +31,7 @@ using Gtk; using MonoDevelop.Core; using MonoDevelop.Ide.Gui.Dialogs; using MonoDevelop.Components; +using MonoDevelop.Ide.Editor; namespace MonoDevelop.Ide.CodeTemplates { @@ -41,14 +42,15 @@ namespace MonoDevelop.Ide.CodeTemplates Gtk.TreeStore templateStore; CellRendererText templateCellRenderer; CellRendererImage pixbufCellRenderer; - Mono.TextEditor.TextEditor textEditor = new Mono.TextEditor.TextEditor (); - Mono.TextEditor.TextEditorOptions options; + TextEditor textEditor = TextEditorFactory.CreateNewEditor (); + ITextEditorOptions options; public CodeTemplatePanelWidget (OptionsDialog parent) { this.Build(); - scrolledwindow1.Add (textEditor); - textEditor.ShowAll (); + Gtk.Widget control = textEditor; + scrolledwindow1.Add (control); + control.ShowAll (); templateStore = new TreeStore (typeof (CodeTemplate), typeof (string), typeof (string)); @@ -73,13 +75,9 @@ namespace MonoDevelop.Ide.CodeTemplates treeviewCodeTemplates.ExpandAll (); treeviewCodeTemplates.Selection.Changed += HandleChanged; - - options = new MonoDevelop.Ide.Gui.CommonTextEditorOptions (); - options.ShowLineNumberMargin = false; - options.ShowFoldMargin = false; - options.ShowIconMargin = false; - textEditor.Options = options; - textEditor.Document.ReadOnly = true; + + textEditor.Options = DefaultSourceEditorOptions.PlainEditor; + textEditor.IsReadOnly = true; this.buttonAdd.Clicked += ButtonAddClicked; this.buttonEdit.Clicked += ButtonEditClicked; this.buttonRemove.Clicked += ButtonRemoveClicked; @@ -188,10 +186,10 @@ namespace MonoDevelop.Ide.CodeTemplates CodeTemplate template = templateStore.GetValue (iter, 0) as CodeTemplate; if (template != null) { textEditor.ClearSelection (); - textEditor.Document.MimeType = template.MimeType; - textEditor.Document.Text = template.Code; + textEditor.MimeType = template.MimeType; + textEditor.Text = template.Code; } else { - textEditor.Document.Text = ""; + textEditor.Text = ""; } } } |