/// <summary>
        /// This function is the callback used to execute the command when the menu item is clicked.
        /// See the constructor to see how the menu item is associated with this function using
        /// OleMenuCommandService service and MenuCommand class.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event args.</param>
        public void RunIgnoreFormatCommand()
        {
            _ = Task.Run(() =>
            {
                ItemsCollector itemsCollector   = new ItemsCollector();
                SettingsHandler settingsHandler = new SettingsHandler();

                var settings = SettingsProvider.FormatSettingsModel;
                List <string> documentsToIgnore = itemsCollector.GetFilesToIgnore();

                AddItemsToIgnore(documentsToIgnore, settings, "FilesToIgnore");
                settingsHandler.SaveSettings();
            });
        }
Пример #2
0
        /// <summary>
        /// This function is the callback used to execute the command when the menu item is clicked.
        /// See the constructor to see how the menu item is associated with this function using
        /// OleMenuCommandService service and MenuCommand class.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event args.</param>
        public void RunIgnoreCompileCommand()
        {
            _ = Task.Run(() =>
            {
                var settingsHandler            = new SettingsHandler();
                var itemsCollector             = new ItemsCollector();
                List <string> projectsToIgnore = itemsCollector.GetProjectsToIgnore();

                var settingsModel = SettingsProvider.CompilerSettingsModel;
                AddItemsToIgnore(projectsToIgnore, settingsModel, "ProjectsToIgnore");
                if (projectsToIgnore.Any() == false)
                {
                    List <string> filesToIgnore = itemsCollector.GetFilesToIgnore();
                    AddItemsToIgnore(filesToIgnore, settingsModel, "FilesToIgnore");
                    settingsHandler.SaveSettings();
                }
            });
        }
Пример #3
0
        /// <summary>
        /// This function is the callback used to execute the command when the menu item is clicked.
        /// See the constructor to see how the menu item is associated with this function using
        /// OleMenuCommandService service and MenuCommand class.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event args.</param>
        public void RunIgnoreFormatCommand()
        {
            _ = Task.Run(() =>
            {
                SettingsProvider settingsProvider       = new SettingsProvider();
                FormatSettingsModel formatSettingsModel = settingsProvider.GetFormatSettingsModel();
                string filesToIgnore = formatSettingsModel.FilesToIgnore;

                if (filesToIgnore.Length > 0)
                {
                    ItemsCollector itemsCollector   = new ItemsCollector();
                    List <string> documentsToIgnore = itemsCollector.GetFilesToIgnore();
                    SettingsHandler settingsHandler = new SettingsHandler();

                    FormatSettingsModel settings = formatSettingsModel;
                    AddItemsToIgnore(documentsToIgnore, settings, "FilesToIgnore");
                    settingsHandler.SaveSettings();
                }
            });
        }