diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2014-06-23 12:18:01 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2014-06-23 12:18:01 +0400 |
commit | cbf55da7a430b61bfdeaf62b517acb29e3bdc234 (patch) | |
tree | 77ddfb546e362a86116c144dc3806fe6c8e91e20 | |
parent | 85d6e954f2837e9c3a02bdbe4ee70b1121904082 (diff) |
[Ide] Editor option object is now read only.
It's now up to the backend to implement that - there is nothing to win
for the backends to implement the option interface. They need to wrap
it to their internal option handling anyways.
6 files changed, 28 insertions, 17 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 5e7a54fef9..8562c4afbe 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs @@ -76,11 +76,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.Options.ShowLineNumberMargin = false; + textEditor.Options.ShowFoldMargin = false; + textEditor.Options.ShowIconMargin = false; textEditor.IsReadOnly = true; this.buttonAdd.Clicked += ButtonAddClicked; this.buttonEdit.Clicked += ButtonEditClicked; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs index 0a66c8f34c..4a551ca4b5 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs @@ -71,13 +71,11 @@ namespace MonoDevelop.Ide.CodeTemplates scrolledwindow1.Child = control; control.ShowAll (); textEditor.CaretPositionChanged += CaretPositionChanged; - options = new TextEditorOptions (); - options.ShowLineNumberMargin = false; - options.ShowFoldMargin = false; - options.ShowIconMargin = false; - options.ColorScheme = IdeApp.Preferences.ColorScheme; - textEditor.Options = options; - + textEditor.Options.ShowLineNumberMargin = false; + textEditor.Options.ShowFoldMargin = false; + textEditor.Options.ShowIconMargin = false; + textEditor.Options.ColorScheme = IdeApp.Preferences.ColorScheme; + var mimeTypes = new HashSet<string> (); var groups = new HashSet<string> (); foreach (CodeTemplate ct in CodeTemplateService.Templates) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IFoldSegment.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IFoldSegment.cs index 1a1ed42a82..6fbc5b73f0 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IFoldSegment.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IFoldSegment.cs @@ -28,6 +28,14 @@ using MonoDevelop.Core.Text; namespace MonoDevelop.Ide.Editor { + public enum FoldingType { + None, + Region, + TypeDefinition, + TypeMember, + Comment + } + public interface IFoldSegment : ISegment { bool IsFolded { @@ -39,6 +47,11 @@ namespace MonoDevelop.Ide.Editor get; set; } + + FoldingType FoldingType { + get; + set; + } } public class FoldSegment : AbstractSegment, IFoldSegment @@ -53,6 +66,11 @@ namespace MonoDevelop.Ide.Editor set; } + public FoldingType FoldingType { + get; + set; + } + public FoldSegment (int offset, int length, bool isFolded = false) : base (offset, length) { this.IsFolded = isFolded; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextEditorImpl.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextEditorImpl.cs index 1f02f56340..c6c121b808 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextEditorImpl.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextEditorImpl.cs @@ -41,7 +41,7 @@ namespace MonoDevelop.Ide.Editor { EditMode EditMode { get; } ISyntaxMode SyntaxMode { get; set; } - ITextEditorOptions Options { get; set; } + ITextEditorOptions Options { get; } IReadonlyTextDocument Document { get; set; } TextLocation CaretLocation { get; set; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextEditorOptions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextEditorOptions.cs index ce3ebd7c65..31d6af7cbc 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextEditorOptions.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextEditorOptions.cs @@ -66,7 +66,7 @@ namespace MonoDevelop.Ide.Editor Virtual } - public interface ITextEditorOptions : IDisposable + public interface ITextEditorOptions : IDisposable { double Zoom { get; set; } bool CanZoomIn { get; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs index 140680f9c0..5333432ac8 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs @@ -88,9 +88,6 @@ namespace MonoDevelop.Ide.Editor get { return textEditorImpl.Options; } - set { - textEditorImpl.Options = value; - } } public EditMode EditMode { |