diff options
author | Rodrigo Moya <rodrigo.moya@xamarin.com> | 2019-11-02 02:29:51 +0300 |
---|---|---|
committer | Rodrigo Moya <rodrigo.moya@xamarin.com> | 2019-11-13 21:59:27 +0300 |
commit | dffda75a07e2cfb60ee55348a37f0280df0596a4 (patch) | |
tree | 4c2a041b8f2a36e7c94ed601c7ded10014a7be28 /main/src/addins/MonoDevelop.TextEditor | |
parent | 72085830ec637621a05b0a498e3d2165d0c17769 (diff) |
[Core] Switch FeatureSwitchService to use XML rather than classes
Diffstat (limited to 'main/src/addins/MonoDevelop.TextEditor')
3 files changed, 5 insertions, 46 deletions
diff --git a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/Properties/MonoDevelop.TextEditor.addin.xml b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/Properties/MonoDevelop.TextEditor.addin.xml index 3db10c4b70..ae2054e3cb 100644 --- a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/Properties/MonoDevelop.TextEditor.addin.xml +++ b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/Properties/MonoDevelop.TextEditor.addin.xml @@ -340,4 +340,8 @@ <Description>TextMate folder with syntax highlighting definitions, code snippets and syntax color themes</Description> <ExtensionNode name="Repository" type="MonoDevelop.TextEditor.TextMateRepositoryExtensionNode"/> </ExtensionPoint> + + <Extension path="/MonoDevelop/Ide/FeatureSwitches"> + <FeatureSwitch id="AlwaysUseLegacyEditor" description="Enable old editor" defaultValue="false" /> + </Extension> </ExtensionModel> diff --git a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextEditorFeatureSwitchController.cs b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextEditorFeatureSwitchController.cs deleted file mode 100644 index 1d2491cb07..0000000000 --- a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextEditorFeatureSwitchController.cs +++ /dev/null @@ -1,45 +0,0 @@ -// -// TextEditorFeatureSwitchController.cs -// -// Author: -// Rodrigo Moya <rodrigo.moya@xamarin.com> -// -// Copyright (c) 2019 Microsoft, Corp. (http://microsoft.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using Mono.Addins; -using MonoDevelop.Core; -using MonoDevelop.Core.FeatureConfiguration; - -namespace MonoDevelop.TextEditor -{ - [Extension (typeof (IFeatureSwitchController))] - class TextEditorFeatureSwitchController : BaseFeatureSwitchController - { - internal const string AlwaysUseLegacyEditorFeatureSwitchName = "AlwaysUseLegacyEditor"; - - public TextEditorFeatureSwitchController () - { - AddFeatureSwitch (AlwaysUseLegacyEditorFeatureSwitchName, - GettextCatalog.GetString ("Enable old editor"), - false); - } - } -} diff --git a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewDisplayBinding.cs b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewDisplayBinding.cs index ee04bc9bcf..93811e16d4 100644 --- a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewDisplayBinding.cs +++ b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewDisplayBinding.cs @@ -40,7 +40,7 @@ namespace MonoDevelop.TextEditor new Dictionary<(string addinId, string providerType), ILegacyEditorSupportProvider> (); readonly Lazy<bool> alwaysUseLegacyEditor = new Lazy<bool> ( - () => FeatureSwitchService.IsFeatureEnabled (TextEditorFeatureSwitchController.AlwaysUseLegacyEditorFeatureSwitchName).GetValueOrDefault ()); + () => FeatureSwitchService.IsFeatureEnabled ("AlwaysUseLegacyEditor").GetValueOrDefault ()); public override string Id => "MonoDevelop.TextEditor.TextViewControllerFactory"; |