Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseCommand" /> class.
        /// </summary>
        /// <param name="package">The hosting package.</param>
        /// <param name="id">The id for the command.</param>
        protected BaseCommand(CodeMaidPackage package, CommandID id)
            : base(BaseCommand_Execute, id)
        {
            Package = package;

            BeforeQueryStatus += BaseCommand_BeforeQueryStatus;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="CleanupOpenCodeCommand" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 internal CleanupOpenCodeCommand(CodeMaidPackage package)
     : base(package,
            new CommandID(GuidList.GuidCodeMaidCommandCleanupOpenCode, (int)PkgCmdIDList.CmdIDCodeMaidCleanupOpenCode))
 {
     CodeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(Package);
     CodeCleanupManager = CodeCleanupManager.GetInstance(Package);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CleaningFileTypesViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="activeSettings">The active settings.</param>
 public CleaningFileTypesViewModel(CodeMaidPackage package, Settings activeSettings)
     : base(package, activeSettings)
 {
     Mappings = new SettingsToOptionsList(ActiveSettings, this)
     {
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_ExcludeT4GeneratedCode, x => ExcludeT4GeneratedCode),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Cleaning_ExclusionExpression, x => ExclusionExpression),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_IncludeCPlusPlus, x => IncludeCPlusPlus),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_IncludeCSharp, x => IncludeCSharp),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_IncludeCSS, x => IncludeCSS),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_IncludeEverythingElse, x => IncludeEverythingElse),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_IncludeFSharp, x => IncludeFSharp),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_IncludeHTML, x => IncludeHTML),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_IncludeJavaScript, x => IncludeJavaScript),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_IncludeJSON, x => IncludeJSON),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_IncludeLESS, x => IncludeLESS),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_IncludePHP, x => IncludePHP),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_IncludePowerShell, x => IncludePowerShell),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_IncludeR, x => IncludeR),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_IncludeSCSS, x => IncludeSCSS),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_IncludeTypeScript, x => IncludeTypeScript),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_IncludeVB, x => IncludeVisualBasic),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_IncludeXAML, x => IncludeXAML),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_IncludeXML, x => IncludeXML)
     };
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CleaningUpdateViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="activeSettings">The active settings.</param>
 public CleaningUpdateViewModel(CodeMaidPackage package, Settings activeSettings)
     : base(package, activeSettings)
 {
     Mappings = new SettingsToOptionsList(ActiveSettings, this)
     {
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_UpdateAccessorsToBothBeSingleLineOrMultiLine, x => UpdateAccessorsToBothBeSingleLineOrMultiLine),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_UpdateEndRegionDirectives, x => UpdateEndRegionDirectives),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Cleaning_UpdateFileHeaderCPlusPlus, x => UpdateFileHeaderCPlusPlus),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Cleaning_UpdateFileHeaderCSharp, x => UpdateFileHeaderCSharp),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Cleaning_UpdateFileHeaderCSS, x => UpdateFileHeaderCSS),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Cleaning_UpdateFileHeaderFSharp, x => UpdateFileHeaderFSharp),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Cleaning_UpdateFileHeaderHTML, x => UpdateFileHeaderHTML),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Cleaning_UpdateFileHeaderJavaScript, x => UpdateFileHeaderJavaScript),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Cleaning_UpdateFileHeaderJSON, x => UpdateFileHeaderJSON),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Cleaning_UpdateFileHeaderLESS, x => UpdateFileHeaderLESS),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Cleaning_UpdateFileHeaderPHP, x => UpdateFileHeaderPHP),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Cleaning_UpdateFileHeaderPowerShell, x => UpdateFileHeaderPowerShell),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Cleaning_UpdateFileHeaderR, x => UpdateFileHeaderR),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Cleaning_UpdateFileHeaderSCSS, x => UpdateFileHeaderSCSS),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Cleaning_UpdateFileHeaderTypeScript, x => UpdateFileHeaderTypeScript),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Cleaning_UpdateFileHeaderVB, x => UpdateFileHeaderVisualBasic),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Cleaning_UpdateFileHeaderXAML, x => UpdateFileHeaderXAML),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Cleaning_UpdateFileHeaderXML, x => UpdateFileHeaderXML),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_UpdateSingleLineMethods, x => UpdateSingleLineMethods)
     };
 }
Beispiel #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FormattingViewModel" /> class.
        /// </summary>
        /// <param name="package">The hosting package.</param>
        /// <param name="activeSettings">The active settings.</param>
        public FormattingViewModel(CodeMaidPackage package, Settings activeSettings)
            : base(package, activeSettings)
        {
            Mappings = new SettingsToOptionsList(ActiveSettings, this)
            {
                new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Formatting_CommentRunDuringCleanup, x => CommentRunDuringCleanup),
                new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Formatting_CommentSkipWrapOnLastWord, x => CommentSkipWrapOnLastWord),
                new SettingToOptionMapping<int, int>(x => ActiveSettings.Formatting_CommentWrapColumn, x => CommentWrapColumn),
                new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Formatting_CommentXmlAlignParamTags, x => CommentXmlAlignParamTags),
                new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Formatting_CommentXmlKeepTagsTogether, x => CommentXmlKeepTagsTogether),
                new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Formatting_CommentXmlSpaceSingleTags, x => CommentXmlSpaceSingleTags),
                new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Formatting_CommentXmlSpaceTags, x => CommentXmlSpaceTags),
                new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Formatting_CommentXmlSplitAllTags, x => CommentXmlSplitAllTags),
                new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Formatting_CommentXmlSplitSummaryTagToMultipleLines, x => CommentXmlSplitSummaryTagToMultipleLines),
                new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Formatting_CommentXmlTagsToLowerCase, x => CommentXmlTagsToLowerCase),
                new SettingToOptionMapping<int, int>(x => ActiveSettings.Formatting_CommentXmlValueIndent, x => CommentXmlValueIndent)
            };

            _editorProperties = Package.IDE.Properties["FontsAndColors", "TextEditor"];
            var property = _editorProperties.Item("FontsAndColorsItems");
            var fontsAndColorsItems = (EnvDTE.FontsAndColorsItems)property.Object;
            _commentColors = fontsAndColorsItems.Item("Comment");

            PropertyChanged += (sender, args) => UpdatePreviewText();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="SpadeContextInsertRegionCommand" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 internal SpadeContextInsertRegionCommand(CodeMaidPackage package)
     : base(package,
            new CommandID(GuidList.GuidCodeMaidCommandSpadeContextInsertRegion, (int)PkgCmdIDList.CmdIDCodeMaidSpadeContextInsertRegion))
 {
     _generateRegionLogic = GenerateRegionLogic.GetInstance(package);
     _undoTransactionHelper = new UndoTransactionHelper(package, "CodeMaid Insert Region");
 }
Beispiel #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WindowEventListener" /> class.
 /// </summary>
 /// <param name="package">The package hosting the event listener.</param>
 internal WindowEventListener(CodeMaidPackage package)
     : base(package)
 {
     // Store access to the window events, otherwise events will not register properly via DTE.
     WindowEvents = Package.IDE.Events.get_WindowEvents(null);
     WindowEvents.WindowActivated += WindowEvents_WindowActivated;
 }
Beispiel #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CommentFormatCommand" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 internal CommentFormatCommand(CodeMaidPackage package)
     : base(package,
            new CommandID(PackageGuids.GuidCodeMaidCommandCommentFormat, PackageIds.CmdIDCodeMaidCommentFormat))
 {
     _undoTransactionHelper = new UndoTransactionHelper(package, "CodeMaid Format Comment");
     _commentFormatLogic = CommentFormatLogic.GetInstance(package);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DocumentEventListener" /> class.
 /// </summary>
 /// <param name="package">The package hosting the event listener.</param>
 internal DocumentEventListener(CodeMaidPackage package)
     : base(package)
 {
     // Store access to the document events, otherwise events will not register properly via DTE.
     DocumentEvents = Package.IDE.Events.DocumentEvents;
     DocumentEvents.DocumentClosing += DocumentEvents_DocumentClosing;
 }
Beispiel #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RemoveRegionCommand" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 internal RemoveRegionCommand(CodeMaidPackage package)
     : base(package,
            new CommandID(PackageGuids.GuidCodeMaidCommandRemoveRegion, PackageIds.CmdIDCodeMaidRemoveRegion))
 {
     _codeModelHelper = CodeModelHelper.GetInstance(package);
     _removeRegionLogic = RemoveRegionLogic.GetInstance(package);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CommentFormatCommand" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 internal CommentFormatCommand(CodeMaidPackage package)
     : base(package,
            new CommandID(GuidList.GuidCodeMaidCommandCommentFormat, (int)PkgCmdIDList.CmdIDCodeMaidCommentFormat))
 {
     _undoTransactionHelper = new UndoTransactionHelper(package, "Format Comment");
     _commentFormatLogic = CommentFormatLogic.GetInstance(package);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RemoveRegionCommand" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 internal RemoveRegionCommand(CodeMaidPackage package)
     : base(package,
            new CommandID(GuidList.GuidCodeMaidCommandRemoveRegion, (int)PkgCmdIDList.CmdIDCodeMaidRemoveRegion))
 {
     _codeModelHelper = CodeModelHelper.GetInstance(package);
     _removeRegionLogic = RemoveRegionLogic.GetInstance(package);
 }
Beispiel #13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CodeModelManager" /> class.
        /// </summary>
        /// <param name="package">The hosting package.</param>
        private CodeModelManager(CodeMaidPackage package)
        {
            _package = package;

            _codeModelBuilder = CodeModelBuilder.GetInstance(_package);
            _codeModelCache = new CodeModelCache();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="CleanupActiveCodeCommand" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 internal CleanupActiveCodeCommand(CodeMaidPackage package)
     : base(package,
            new CommandID(PackageGuids.GuidCodeMaidCommandCleanupActiveCode, PackageIds.CmdIDCodeMaidCleanupActiveCode))
 {
     CodeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(Package);
     CodeCleanupManager = CodeCleanupManager.GetInstance(Package);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TextEditorEventListener" /> class.
 /// </summary>
 /// <param name="package">The package hosting the event listener.</param>
 internal TextEditorEventListener(CodeMaidPackage package)
     : base(package)
 {
     // Store access to the text editor events, otherwise events will not register properly
     // via DTE.
     TextEditorEvents = Package.IDE.Events.TextEditorEvents;
     TextEditorEvents.LineChanged += TextEditorEvents_LineChanged;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="FormattingViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 public FormattingViewModel(CodeMaidPackage package)
     : base(package)
 {
     _editorProperties = Package.IDE.Properties["FontsAndColors", "TextEditor"];
     var property = _editorProperties.Item("FontsAndColorsItems");
     var fontsAndColorsItems = (EnvDTE.FontsAndColorsItems)property.Object;
     _commentColors = fontsAndColorsItems.Item("Comment");
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ReorganizeActiveCodeCommand" /> class.
        /// </summary>
        /// <param name="package">The hosting package.</param>
        internal ReorganizeActiveCodeCommand(CodeMaidPackage package)
            : base(package,
                   new CommandID(PackageGuids.GuidCodeMaidCommandReorganizeActiveCode, PackageIds.CmdIDCodeMaidReorganizeActiveCode))
        {
            CodeReorganizationManager = CodeReorganizationManager.GetInstance(Package);

            _codeReorganizationAvailabilityLogic = CodeReorganizationAvailabilityLogic.GetInstance(Package);
        }
Beispiel #18
0
        /// <summary>
        /// Gets the top level (solution) UI hierarchy item.
        /// </summary>
        /// <param name="package">The hosting package.</param>
        /// <returns>The top level (solution) UI hierarchy item, otherwise null.</returns>
        internal static UIHierarchyItem GetTopUIHierarchyItem(CodeMaidPackage package)
        {
            var solutionExplorer = GetSolutionExplorer(package);

            return solutionExplorer.UIHierarchyItems.Count > 0
                ? solutionExplorer.UIHierarchyItems.Item(1)
                : null;
        }
Beispiel #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SwitchingViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="activeSettings">The active settings.</param>
 public SwitchingViewModel(CodeMaidPackage package, Settings activeSettings)
     : base(package, activeSettings)
 {
     Mappings = new SettingsToOptionsList(ActiveSettings, this)
     {
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Switching_RelatedFileExtensionsExpression, x => RelatedFileExtensionsExpression)
     };
 }
Beispiel #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FindingViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="activeSettings">The active settings.</param>
 public FindingViewModel(CodeMaidPackage package, Settings activeSettings)
     : base(package, activeSettings)
 {
     Mappings = new SettingsToOptionsList(ActiveSettings, this)
     {
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Finding_TemporarilyOpenSolutionFolders, x => TemporarilyOpenSolutionFolders)
     };
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SolutionEventListener" /> class.
 /// </summary>
 /// <param name="package">The package hosting the event listener.</param>
 internal SolutionEventListener(CodeMaidPackage package)
     : base(package)
 {
     // Store access to the solutions events, otherwise events will not register properly via DTE.
     SolutionEvents = Package.IDE.Events.SolutionEvents;
     SolutionEvents.Opened += SolutionEvents_Opened;
     SolutionEvents.AfterClosing += SolutionEvents_AfterClosing;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CodeCommentOptions" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="document">The text document.</param>
 public CodeCommentOptions(CodeMaidPackage package, TextDocument document)
 {
     SkipWrapOnLastWord = Settings.Default.Formatting_CommentSkipWrapOnLastWord;
     TabSize = CodeCommentHelper.GetTabSize(package, document);
     WrapAtColumn = Math.Max(Settings.Default.Formatting_CommentWrapColumn, 20);
     XmlAlignParamTags = Settings.Default.Formatting_CommentXmlAlignParamTags;
     XmlSpaceTags = Settings.Default.Formatting_CommentXmlSpaceTags;
     XmlValueIndent = Settings.Default.Formatting_CommentXmlValueIndent;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="RunningDocumentTableEventListener" /> class.
        /// </summary>
        /// <param name="package">The package hosting the event listener.</param>
        internal RunningDocumentTableEventListener(CodeMaidPackage package)
            : base(package)
        {
            // Create and store a reference to the running document table.
            RunningDocumentTable = new RunningDocumentTable(package);

            // Register with the running document table for events.
            EventCookie = RunningDocumentTable.Advise(this);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="OutliningSynchronizationManager" /> class.
        /// </summary>
        /// <param name="package">The hosting package.</param>
        public OutliningSynchronizationManager(CodeMaidPackage package)
        {
            _package = package;

            // Retrieve services needed for outlining from the package.
            _editorAdaptersFactoryService = _package.ComponentModel.GetService<IVsEditorAdaptersFactoryService>();
            _outliningManagerService = _package.ComponentModel.GetService<IOutliningManagerService>();
            _serviceProvider = new ServiceProvider((IServiceProvider)_package.IDE);
        }
Beispiel #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CollapsingViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="activeSettings">The active settings.</param>
 public CollapsingViewModel(CodeMaidPackage package, Settings activeSettings)
     : base(package, activeSettings)
 {
     Mappings = new SettingsToOptionsList(ActiveSettings, this)
     {
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Collapsing_CollapseSolutionWhenOpened, x => CollapseSolutionWhenOpened),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Collapsing_KeepSoloProjectExpanded, x => KeepSoloProjectExpanded)
     };
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="RegionsRemoveAndInsertWithAccessModifiers" /> class.
        /// </summary>
        /// <param name="package">The hosting package.</param>
        internal RegionsRemoveAndInsertWithAccessModifiers(CodeMaidPackage package)
        {
            #region RegionsInMethodsShouldBeIgnored

            Package = package;

            StartTracking();

            #endregion RegionsInMethodsShouldBeIgnored
        }
Beispiel #27
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProgressingViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="activeSettings">The active settings.</param>
 public ProgressingViewModel(CodeMaidPackage package, Settings activeSettings)
     : base(package, activeSettings)
 {
     Mappings = new SettingsToOptionsList(ActiveSettings, this)
     {
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Progressing_HideBuildProgressOnBuildStop, x => HideBuildProgressOnBuildStop),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Progressing_ShowBuildProgressOnBuildStart, x => ShowBuildProgressOnBuildStart),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Progressing_ShowProgressOnWindowsTaskbar, x => ShowProgressOnWindowsTaskbar)
     };
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ShellEventListener" /> class.
 /// </summary>
 /// <param name="package">The package hosting the event listener.</param>
 /// <param name="shellService">The shell service.</param>
 internal ShellEventListener(CodeMaidPackage package, IVsShell shellService)
     : base(package)
 {
     _shellService = shellService;
     if (_shellService != null)
     {
         _shellService.AdviseBroadcastMessages(this, out _broadcastEventCookie);
         _shellService.AdviseShellPropertyChanges(this, out _propertyEventCookie);
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="BuildProgressEventListener" /> class.
 /// </summary>
 /// <param name="package">The package hosting the event listener.</param>
 internal BuildProgressEventListener(CodeMaidPackage package)
     : base(package)
 {
     // Store access to the build events, otherwise events will not register properly via DTE.
     BuildEvents = Package.IDE.Events.BuildEvents;
     BuildEvents.OnBuildBegin += BuildEvents_OnBuildBegin;
     BuildEvents.OnBuildProjConfigBegin += BuildEvents_OnBuildProjConfigBegin;
     BuildEvents.OnBuildProjConfigDone += BuildEvents_OnBuildProjConfigDone;
     BuildEvents.OnBuildDone += BuildEvents_OnBuildDone;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CleaningGeneralViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="activeSettings">The active settings.</param>
 public CleaningGeneralViewModel(CodeMaidPackage package, Settings activeSettings)
     : base(package, activeSettings)
 {
     Mappings = new SettingsToOptionsList(ActiveSettings, this)
     {
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_AutoCleanupOnFileSave, x => AutoCleanupOnFileSave),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_AutoSaveAndCloseIfOpenedByCleanup, x => AutoSaveAndCloseIfOpenedByCleanup),
         new SettingToOptionMapping<int, AskYesNo>(x => ActiveSettings.Cleaning_PerformPartialCleanupOnExternal, x => PerformPartialCleanupOnExternal)
     };
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CleaningUpdateViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 public CleaningUpdateViewModel(CodeMaidPackage package)
     : base(package)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ReadOnlyToggleCommand" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 internal ReadOnlyToggleCommand(CodeMaidPackage package)
     : base(package,
            new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidReadOnlyToggle))
 {
 }
Beispiel #33
0
 /// <summary>
 /// Gets an instance of the <see cref="CommentFormatLogic" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <returns>An instance of the <see cref="CommentFormatLogic" /> class.</returns>
 internal static CommentFormatLogic GetInstance(CodeMaidPackage package)
 {
     return(_instance ?? (_instance = new CommentFormatLogic(package)));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="OptionsCommand" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 internal OptionsCommand(CodeMaidPackage package)
     : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidOptions)
 {
 }
Beispiel #35
0
 public static void Initialize(CodeMaidPackage package)
 {
     Instance = new OptionsCommand(package);
     Instance.Switch(on: true);
 }
Beispiel #36
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProgressingViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 public ProgressingViewModel(CodeMaidPackage package)
     : base(package)
 {
 }
 /// <summary>
 /// Gets an instance of the <see cref="CodeReorganizationManager" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <returns>An instance of the <see cref="CodeReorganizationManager" /> class.</returns>
 internal static CodeReorganizationManager GetInstance(CodeMaidPackage package)
 {
     return(_instance ?? (_instance = new CodeReorganizationManager(package)));
 }
Beispiel #38
0
 /// <summary>
 /// Gets an instance of the <see cref="CodeModelManager" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <returns>An instance of the <see cref="CodeModelManager" /> class.</returns>
 internal static CodeModelManager GetInstance(CodeMaidPackage package)
 {
     return(_instance ?? (_instance = new CodeModelManager(package)));
 }
Beispiel #39
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AboutCommand" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 internal AboutCommand(CodeMaidPackage package)
     : base(package,
            new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidAbout))
 {
 }
Beispiel #40
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CleaningParentViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 public CleaningParentViewModel(CodeMaidPackage package)
     : base(package)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CloseAllReadOnlyCommand" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 internal CloseAllReadOnlyCommand(CodeMaidPackage package)
     : base(package,
            new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidCloseAllReadOnly))
 {
 }
 /// <summary>
 /// Gets an instance of the <see cref="CodeCleanupAvailabilityLogic" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <returns>An instance of the <see cref="CodeCleanupAvailabilityLogic" /> class.</returns>
 internal static CodeCleanupAvailabilityLogic GetInstance(CodeMaidPackage package)
 {
     return(_instance ?? (_instance = new CodeCleanupAvailabilityLogic(package)));
 }
Beispiel #43
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UndoTransactionHelper" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="transactionName">The name of the transaction.</param>
 public UndoTransactionHelper(CodeMaidPackage package, string transactionName)
 {
     _package         = package;
     _transactionName = transactionName;
 }
Beispiel #44
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DiggingViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 public DiggingViewModel(CodeMaidPackage package)
     : base(package)
 {
 }
Beispiel #45
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CodeCleanupAvailabilityLogic" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 private CodeCleanupAvailabilityLogic(CodeMaidPackage package)
 {
     _package = package;
 }
Beispiel #46
0
 public static void Initialize(CodeMaidPackage package)
 {
     Instance = new SettingCleanupOnSaveCommand(package);
     package.SettingsMonitor.Watch(s => s.Feature_SettingCleanupOnSave, Instance.Switch);
 }
Beispiel #47
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SettingCleanupOnSaveCommand" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 internal SettingCleanupOnSaveCommand(CodeMaidPackage package)
     : base(package,
            new CommandID(GuidList.GuidCodeMaidCommandSettingCleanupOnSave, (int)PkgCmdIDList.CmdIDCodeMaidSettingCleanupOnSave))
 {
 }
 /// <summary>
 /// Initializes a singleton instance of this command.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <returns>A task.</returns>
 public static async Task InitializeAsync(CodeMaidPackage package)
 {
     Instance = new OptionsCommand(package);
     await Instance.SwitchAsync(on : true);
 }
Beispiel #49
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SettingCleanupOnSaveCommand" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 internal SettingCleanupOnSaveCommand(CodeMaidPackage package)
     : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSettingCleanupOnSave)
 {
 }
Beispiel #50
0
 public static void Initialize(CodeMaidPackage package)
 {
     Instance = new SortLinesCommand(package);
     package.SettingsMonitor.Watch(s => s.Feature_SortLines, Instance.Switch);
 }
Beispiel #51
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CollapseAllSolutionExplorerCommand" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 internal CollapseAllSolutionExplorerCommand(CodeMaidPackage package)
     : base(package,
            new CommandID(GuidList.GuidCodeMaidCommandCollapseAllSolutionExplorer, (int)PkgCmdIDList.CmdIDCodeMaidCollapseAllSolutionExplorer))
 {
 }
Beispiel #52
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RemoveWhitespaceLogic" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 private RemoveWhitespaceLogic(CodeMaidPackage package)
 {
     _package = package;
 }
Beispiel #53
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ReorganizingRegionsViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 public ReorganizingRegionsViewModel(CodeMaidPackage package)
     : base(package)
 {
 }
Beispiel #54
0
 public static void Initialize(CodeMaidPackage package)
 {
     Instance = new NestOutFileCommand(package);
     //监控配置文件决定是否启用该功能,不然无法显示按钮
     package.SettingsMonitor.Watch(s => s.NestInOutFile, Instance.Switch);
 }
Beispiel #55
0
 /// <summary>
 /// Initializes a new instance of the <see
 /// cref="NestOutFileCommand" /> class.
 /// </summary>
 /// <param name="package">
 /// The hosting package.
 /// </param>
 internal NestOutFileCommand(CodeMaidPackage package)
     : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidNestOutFile)
 {
 }
Beispiel #56
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SortLinesCommand" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 internal SortLinesCommand(CodeMaidPackage package)
     : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSortLines)
 {
     _undoTransactionHelper = new UndoTransactionHelper(package, Resources.CodeMaidSort);
 }
Beispiel #57
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CommentFormatLogic" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 private CommentFormatLogic(CodeMaidPackage package)
 {
     _package = package;
 }
Beispiel #58
0
 /// <summary>
 /// Gets an instance of the <see cref="RemoveWhitespaceLogic" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <returns>An instance of the <see cref="RemoveWhitespaceLogic" /> class.</returns>
 internal static RemoveWhitespaceLogic GetInstance(CodeMaidPackage package)
 {
     return(_instance ?? (_instance = new RemoveWhitespaceLogic(package)));
 }
Beispiel #59
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CloseAllReadOnlyCommand" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 internal CloseAllReadOnlyCommand(CodeMaidPackage package)
     : base(package,
            new CommandID(GuidList.GuidCodeMaidCommandCloseAllReadOnly, (int)PkgCmdIDList.CmdIDCodeMaidCloseAllReadOnly))
 {
 }
Beispiel #60
0
 /// <summary>
 /// Gets the solution explorer for the specified hosting package.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <returns>The solution explorer.</returns>
 internal static UIHierarchy GetSolutionExplorer(CodeMaidPackage package)
 {
     return(package.IDE.ToolWindows.SolutionExplorer);
 }