Esempio n. 1
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="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)
     };
 }
Esempio n. 3
0
 /// <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)
     };
 }
Esempio n. 4
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)
     };
 }
Esempio n. 5
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)
     };
 }
Esempio n. 6
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)
     };
 }
Esempio n. 7
0
 /// <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)
     };
 }
Esempio n. 8
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)
     };
 }
Esempio n. 9
0
 /// <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<bool, bool>(x => ActiveSettings.Cleaning_UpdateSingleLineMethods, x => UpdateSingleLineMethods)
     };
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ReorganizingGeneralViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="activeSettings">The active settings.</param>
 public ReorganizingGeneralViewModel(CodeMaidPackage package, Settings activeSettings)
     : base(package, activeSettings)
 {
     Mappings = new SettingsToOptionsList(ActiveSettings, this)
     {
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Reorganizing_AlphabetizeMembersOfTheSameGroup, x => AlphabetizeMembersOfTheSameGroup),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Reorganizing_KeepMembersWithinRegions, x => KeepMembersWithinRegions),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Reorganizing_PrimaryOrderByAccessLevel, x => PrimaryOrderByAccessLevel),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Reorganizing_RunAtStartOfCleanup, x => RunAtStartOfCleanup)
     };
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ReorganizingRegionsViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="activeSettings">The active settings.</param>
 public ReorganizingRegionsViewModel(CodeMaidPackage package, Settings activeSettings)
     : base(package, activeSettings)
 {
     Mappings = new SettingsToOptionsList(ActiveSettings, this)
     {
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Reorganizing_RegionsIncludeAccessLevel, x => IncludeAccessLevel),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Reorganizing_RegionsInsertKeepEvenIfEmpty, x => InsertKeepEvenIfEmpty),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Reorganizing_RegionsInsertNewRegions, x => InsertNewRegions),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Reorganizing_RegionsRemoveExistingRegions, x => RemoveExistingRegions)
     };
 }
Esempio n. 12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ThirdPartyViewModel" /> class.
        /// </summary>
        /// <param name="package">The hosting package.</param>
        /// <param name="activeSettings">The active settings.</param>
        public ThirdPartyViewModel(CodeMaidPackage package, Settings activeSettings)
            : base(package, activeSettings)
        {
            Mappings = new SettingsToOptionsList(ActiveSettings, this)
            {
                new SettingToOptionMapping<bool, bool>(x => ActiveSettings.ThirdParty_UseJetBrainsReSharperCleanup, x => UseJetBrainsReSharperCleanup),
                new SettingToOptionMapping<bool, bool>(x => ActiveSettings.ThirdParty_UseTelerikJustCodeCleanup, x => UseTelerikJustCodeCleanup),
                new SettingToOptionMapping<bool, bool>(x => ActiveSettings.ThirdParty_UseXAMLStylerCleanup, x => UseXAMLStylerCleanup),
                new SettingToOptionMapping<string, string>(x => ActiveSettings.ThirdParty_OtherCleaningCommandsExpression, x => OtherCleaningCommandsExpression)
            };

            _commandHelper = CommandHelper.GetInstance(package);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="CleaningVisualStudioViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="activeSettings">The active settings.</param>
 public CleaningVisualStudioViewModel(CodeMaidPackage package, Settings activeSettings)
     : base(package, activeSettings)
 {
     Mappings = new SettingsToOptionsList(ActiveSettings, this)
     {
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_RunVisualStudioFormatDocumentCommand, x => RunVisualStudioFormatDocument),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_RunVisualStudioRemoveUnusedUsingStatements, x => RunVisualStudioRemoveUnusedUsingStatements),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_RunVisualStudioSortUsingStatements, x => RunVisualStudioSortUsingStatements),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_SkipRemoveUnusedUsingStatementsDuringAutoCleanupOnSave, x => SkipRemoveUnusedUsingStatementsDuringAutoCleanupOnSave),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_SkipSortUsingStatementsDuringAutoCleanupOnSave, x => SkipSortUsingStatementsDuringAutoCleanupOnSave),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.Cleaning_UsingStatementsToReinsertWhenRemovedExpression, x => UsingStatementsToReinsertWhenRemovedExpression)
     };
 }
Esempio n. 14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CleaningInsertViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="activeSettings">The active settings.</param>
 public CleaningInsertViewModel(CodeMaidPackage package, Settings activeSettings)
     : base(package, activeSettings)
 {
     Mappings = new SettingsToOptionsList(ActiveSettings, this)
     {
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingAfterClasses, x => InsertBlankLinePaddingAfterClasses),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingAfterDelegates, x => InsertBlankLinePaddingAfterDelegates),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingAfterEndRegionTags, x => InsertBlankLinePaddingAfterEndRegionTags),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingAfterEnumerations, x => InsertBlankLinePaddingAfterEnumerations),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingAfterEvents, x => InsertBlankLinePaddingAfterEvents),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingAfterFieldsMultiLine, x => InsertBlankLinePaddingAfterFieldsMultiLine),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingAfterInterfaces, x => InsertBlankLinePaddingAfterInterfaces),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingAfterMethods, x => InsertBlankLinePaddingAfterMethods),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingAfterNamespaces, x => InsertBlankLinePaddingAfterNamespaces),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingAfterPropertiesMultiLine, x => InsertBlankLinePaddingAfterPropertiesMultiLine),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingAfterPropertiesSingleLine, x => InsertBlankLinePaddingAfterPropertiesSingleLine),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingAfterRegionTags, x => InsertBlankLinePaddingAfterRegionTags),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingAfterStructs, x => InsertBlankLinePaddingAfterStructs),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingAfterUsingStatementBlocks, x => InsertBlankLinePaddingAfterUsingStatementBlocks),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingBeforeCaseStatements, x => InsertBlankLinePaddingBeforeCaseStatements),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingBeforeClasses, x => InsertBlankLinePaddingBeforeClasses),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingBeforeDelegates, x => InsertBlankLinePaddingBeforeDelegates),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingBeforeEndRegionTags, x => InsertBlankLinePaddingBeforeEndRegionTags),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingBeforeEnumerations, x => InsertBlankLinePaddingBeforeEnumerations),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingBeforeEvents, x => InsertBlankLinePaddingBeforeEvents),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingBeforeFieldsMultiLine, x => InsertBlankLinePaddingBeforeFieldsMultiLine),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingBeforeInterfaces, x => InsertBlankLinePaddingBeforeInterfaces),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingBeforeMethods, x => InsertBlankLinePaddingBeforeMethods),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingBeforeNamespaces, x => InsertBlankLinePaddingBeforeNamespaces),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingBeforePropertiesMultiLine, x => InsertBlankLinePaddingBeforePropertiesMultiLine),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingBeforePropertiesSingleLine, x => InsertBlankLinePaddingBeforePropertiesSingleLine),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingBeforeRegionTags, x => InsertBlankLinePaddingBeforeRegionTags),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingBeforeSingleLineComments, x => InsertBlankLinePaddingBeforeSingleLineComments),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingBeforeStructs, x => InsertBlankLinePaddingBeforeStructs),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingBeforeUsingStatementBlocks, x => InsertBlankLinePaddingBeforeUsingStatementBlocks),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankLinePaddingBetweenPropertiesMultiLineAccessors, x => InsertBlankLinePaddingBetweenPropertiesMultiLineAccessors),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertBlankSpaceBeforeSelfClosingAngleBrackets, x => InsertBlankSpaceBeforeSelfClosingAngleBrackets),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertEndOfFileTrailingNewLine, x => InsertEndOfFileTrailingNewLine),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertExplicitAccessModifiersOnClasses, x => InsertExplicitAccessModifiersOnClasses),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertExplicitAccessModifiersOnDelegates, x => InsertExplicitAccessModifiersOnDelegates),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertExplicitAccessModifiersOnEnumerations, x => InsertExplicitAccessModifiersOnEnumerations),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertExplicitAccessModifiersOnEvents, x => InsertExplicitAccessModifiersOnEvents),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertExplicitAccessModifiersOnFields, x => InsertExplicitAccessModifiersOnFields),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertExplicitAccessModifiersOnInterfaces, x => InsertExplicitAccessModifiersOnInterfaces),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertExplicitAccessModifiersOnMethods, x => InsertExplicitAccessModifiersOnMethods),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertExplicitAccessModifiersOnProperties, x => InsertExplicitAccessModifiersOnProperties),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_InsertExplicitAccessModifiersOnStructs, x => InsertExplicitAccessModifiersOnStructs)
     };
 }
Esempio n. 15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CodeCommentOptions" /> class.
        /// </summary>
        /// <param name="settings">The settings container.</param>
        public CodeCommentOptions(Settings settings)
        {
            SkipWrapOnLastWord = settings.Formatting_CommentSkipWrapOnLastWord;
            WrapAtColumn = Math.Max(settings.Formatting_CommentWrapColumn, 20);
            FormatDuringCleanup = settings.Formatting_CommentRunDuringCleanup;

            XmlAlignParamTags = settings.Formatting_CommentXmlAlignParamTags;
            XmlSpaceTagContent = settings.Formatting_CommentXmlSpaceTags;
            XmlValueIndent = settings.Formatting_CommentXmlValueIndent;
            XmlSplitSummaryTag = settings.Formatting_CommentXmlSplitSummaryTagToMultipleLines;
            XmlSplitAllTags = settings.Formatting_CommentXmlSplitAllTags;
            XmlSpaceSingleTags = settings.Formatting_CommentXmlSpaceSingleTags;
            XmlTagsToLowerCase = settings.Formatting_CommentXmlTagsToLowerCase;
            XmlKeepTagsTogether = settings.Formatting_CommentXmlKeepTagsTogether;
        }
Esempio n. 16
0
        internal void Save(Settings settings)
        {
            settings.Formatting_CommentSkipWrapOnLastWord = SkipWrapOnLastWord;
            settings.Formatting_CommentWrapColumn = WrapAtColumn;
            settings.Formatting_CommentRunDuringCleanup = FormatDuringCleanup;

            settings.Formatting_CommentXmlAlignParamTags = XmlAlignParamTags;
            settings.Formatting_CommentXmlSpaceTags = XmlSpaceTagContent;
            settings.Formatting_CommentXmlValueIndent = XmlValueIndent;
            settings.Formatting_CommentXmlSplitSummaryTagToMultipleLines = XmlSplitSummaryTag;
            settings.Formatting_CommentXmlSplitAllTags = XmlSplitAllTags;
            settings.Formatting_CommentXmlSpaceSingleTags = XmlSpaceSingleTags;
            settings.Formatting_CommentXmlTagsToLowerCase = XmlTagsToLowerCase;
            settings.Formatting_CommentXmlKeepTagsTogether = XmlKeepTagsTogether;
        }
Esempio n. 17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GeneralViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="activeSettings">The active settings.</param>
 public GeneralViewModel(CodeMaidPackage package, Settings activeSettings)
     : base(package, activeSettings)
 {
     Mappings = new SettingsToOptionsList(ActiveSettings, this)
     {
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.General_CacheFiles, x => CacheFiles),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.General_DiagnosticsMode, x => DiagnosticsMode),
         new SettingToOptionMapping<string, string>(x => ActiveSettings.General_Font, x => Font),
         new SettingToOptionMapping<int, IconSetMode>(x => ActiveSettings.General_IconSet, x => IconSetMode),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.General_LoadModelsAsynchronously, x => LoadModelsAsynchronously),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.General_ShowStartPageOnSolutionClose, x => ShowStartPageOnSolutionClose),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.General_SkipUndoTransactionsDuringAutoCleanupOnSave, x => SkipUndoTransactionsDuringAutoCleanupOnSave),
         new SettingToOptionMapping<int, ThemeMode>(x => ActiveSettings.General_Theme, x => ThemeMode),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.General_UseUndoTransactions, x => UseUndoTransactions)
     };
 }
Esempio n. 18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DiggingViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="activeSettings">The active settings.</param>
 public DiggingViewModel(CodeMaidPackage package, Settings activeSettings)
     : base(package, activeSettings)
 {
     Mappings = new SettingsToOptionsList(ActiveSettings, this)
     {
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Digging_CenterOnWhole, x => CenterOnWhole),
         new SettingToOptionMapping<int, int>(x => ActiveSettings.Digging_ComplexityAlertThreshold, x => ComplexityAlertThreshold),
         new SettingToOptionMapping<int, int>(x => ActiveSettings.Digging_ComplexityWarningThreshold, x => ComplexityWarningThreshold),
         new SettingToOptionMapping<int, int>(x => ActiveSettings.Digging_IndentationMargin, x => IndentationMargin),
         new SettingToOptionMapping<int, CodeSortOrder>(x => ActiveSettings.Digging_PrimarySortOrder, x => PrimarySortOrder),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Digging_SecondarySortTypeByName, x => SecondarySortTypeByName),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Digging_ShowItemComplexity, x => ShowItemComplexity),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Digging_ShowItemMetadata, x => ShowItemMetadata),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Digging_ShowMethodParameters, x => ShowMethodParameters),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Digging_SynchronizeOutlining, x => SynchronizeOutlining)
     };
 }
Esempio n. 19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CleaningRemoveViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="activeSettings">The active settings.</param>
 public CleaningRemoveViewModel(CodeMaidPackage package, Settings activeSettings)
     : base(package, activeSettings)
 {
     Mappings = new SettingsToOptionsList(ActiveSettings, this)
     {
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_RemoveBlankLinesAfterAttributes, x => RemoveBlankLinesAfterAttributes),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_RemoveBlankLinesAfterOpeningBrace, x => RemoveBlankLinesAfterOpeningBraces),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_RemoveBlankLinesAtBottom, x => RemoveBlankLinesAtBottom),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_RemoveBlankLinesAtTop, x => RemoveBlankLinesAtTop),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_RemoveBlankLinesBeforeClosingBrace, x => RemoveBlankLinesBeforeClosingBraces),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_RemoveBlankLinesBeforeClosingTags, x => RemoveBlankLinesBeforeClosingTags),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_RemoveBlankLinesBetweenChainedStatements, x => RemoveBlankLinesBetweenChainedStatements),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_RemoveBlankSpacesBeforeClosingAngleBrackets, x => RemoveBlankSpacesBeforeClosingAngleBrackets),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_RemoveEndOfFileTrailingNewLine, x => RemoveEndOfFileTrailingNewLine),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_RemoveEndOfLineWhitespace, x => RemoveEndOfLineWhitespace),
         new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Cleaning_RemoveMultipleConsecutiveBlankLines, x => RemoveMultipleConsecutiveBlankLines),
         new SettingToOptionMapping<int, NoneEmptyAll>(x => ActiveSettings.Cleaning_RemoveRegions, x => RemoveRegions)
     };
 }
Esempio n. 20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ReorganizingTypesViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="activeSettings">The active settings.</param>
 public ReorganizingTypesViewModel(CodeMaidPackage package, Settings activeSettings)
     : base(package, activeSettings)
 {
     Mappings = new SettingsToOptionsList(ActiveSettings, this)
     {
         new SettingToOptionMapping<string, MemberTypeSetting>(x => ActiveSettings.Reorganizing_MemberTypeClasses, x => Classes),
         new SettingToOptionMapping<string, MemberTypeSetting>(x => ActiveSettings.Reorganizing_MemberTypeConstructors, x => Constructors),
         new SettingToOptionMapping<string, MemberTypeSetting>(x => ActiveSettings.Reorganizing_MemberTypeDelegates, x => Delegates),
         new SettingToOptionMapping<string, MemberTypeSetting>(x => ActiveSettings.Reorganizing_MemberTypeDestructors, x => Destructors),
         new SettingToOptionMapping<string, MemberTypeSetting>(x => ActiveSettings.Reorganizing_MemberTypeEnums, x => Enums),
         new SettingToOptionMapping<string, MemberTypeSetting>(x => ActiveSettings.Reorganizing_MemberTypeEvents, x => Events),
         new SettingToOptionMapping<string, MemberTypeSetting>(x => ActiveSettings.Reorganizing_MemberTypeFields, x => Fields),
         new SettingToOptionMapping<string, MemberTypeSetting>(x => ActiveSettings.Reorganizing_MemberTypeIndexers, x => Indexers),
         new SettingToOptionMapping<string, MemberTypeSetting>(x => ActiveSettings.Reorganizing_MemberTypeInterfaces, x => Interfaces),
         new SettingToOptionMapping<string, MemberTypeSetting>(x => ActiveSettings.Reorganizing_MemberTypeMethods, x => Methods),
         new SettingToOptionMapping<string, MemberTypeSetting>(x => ActiveSettings.Reorganizing_MemberTypeProperties, x => Properties),
         new SettingToOptionMapping<string, MemberTypeSetting>(x => ActiveSettings.Reorganizing_MemberTypeStructs, x => Structs)
     };
 }
Esempio n. 21
0
        /// <summary>
        /// Loads the specified settings object with solution-specific settings if they exist or can
        /// be created.
        /// </summary>
        /// <param name="settings">The settings to update.</param>
        /// <param name="canCreate">A flag indicating if solution-specific settings can be created.</param>
        /// <returns>True if solution-specific settings were loaded, otherwise false.</returns>
        internal bool LoadSolutionSpecificSettings(Settings settings, bool canCreate = false)
        {
            if (_package.IDE.Solution.IsOpen && !string.IsNullOrWhiteSpace(_package.IDE.Solution.FullName))
            {
                var solutionPath = Path.GetDirectoryName(_package.IDE.Solution.FullName);
                if (!string.IsNullOrWhiteSpace(solutionPath))
                {
                    var solutionConfig = Path.Combine(solutionPath, SettingsFilename);

                    // Determine if there is a solution-specific settings file or one can be created.
                    if (File.Exists(solutionConfig) || canCreate)
                    {
                        // Reload the solution settings into the given settings (merge on top of user settings).
                        settings.Context["SolutionPath"] = solutionPath;
                        settings.Reload();
                        return true;
                    }
                }
            }

            return false;
        }
Esempio n. 22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CodeCommentOptions" /> class.
 /// </summary>
 /// <param name="settings">The settings container.</param>
 /// <param name="tabSize">The tab size.</param>
 public CodeCommentOptions(Settings settings, int tabSize)
     : this(settings)
 {
     TabSize = tabSize;
 }
Esempio n. 23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CodeCommentOptions" /> class.
 /// </summary>
 /// <param name="settings">The settings container.</param>
 /// <param name="package">The hosting package.</param>
 /// <param name="document">The text document.</param>
 public CodeCommentOptions(Settings settings, CodeMaidPackage package, TextDocument document)
     : this(settings, CodeCommentHelper.GetTabSize(package, document))
 {
 }
Esempio n. 24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CleaningParentViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="activeSettings">The active settings.</param>
 public CleaningParentViewModel(CodeMaidPackage package, Settings activeSettings)
     : base(package, activeSettings)
 {
 }
Esempio n. 25
0
        /// <summary>
        /// Unloads solution-specific settings from the specified settings object.
        /// </summary>
        /// <param name="settings">The settings to update.</param>
        /// <returns>True if solution-specific settings were unloaded, otherwise false.</returns>
        internal bool UnloadSolutionSpecificSettings(Settings settings)
        {
            // Determine if there is a solution-specific settings file.
            if (settings.Context.ContainsKey("SolutionPath"))
            {
                // Unload the solution settings from the given settings (restore to user settings only).
                settings.Context.Remove("SolutionPath");
                settings.Reload();
                return true;
            }

            return false;
        }
Esempio n. 26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OptionsPageViewModel" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <param name="activeSettings">The active settings.</param>
 protected OptionsPageViewModel(CodeMaidPackage package, Settings activeSettings)
 {
     Package = package;
     ActiveSettings = activeSettings;
 }