Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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.cs26
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 = "";
}
}
}