Пример #1
0
        /// <summary>
        /// Create a new class.
        /// </summary>
        public override void Execute()
        {
            if (App.Instance.SalesForceApp.CurrentProject != null)
            {
                if (App.Instance.SalesForceApp.CurrentProject.IsDownloadingSymbols)
                {
                    throw new Exception("The search index is currently being updated by the Reload symbols process.  Please wait for this to complete and then try again.");
                }

                if (App.MessageUser("All files will be removed from the search index.  Do you wish to proceed?",
                                    "Reset search index",
                                    System.Windows.MessageBoxImage.Warning,
                                    new string[] { "Yes", "No" }) == "Yes")
                {
                    using (SearchIndex searchIndex = new SearchIndex(App.Instance.SalesForceApp.CurrentProject.SearchFolder, true))
                        searchIndex.Clear();

                    App.MessageUser(
                        "The search index has been reset.",
                        "Reset search index",
                        System.Windows.MessageBoxImage.Information,
                        new string[] { "OK" });
                }
            }
        }