private void ClearCache_Click(object sender, RoutedEventArgs e)
        {
            string message;

            if (!ScriptGenAssemblyCache.ClearCache())
            {
                // Show a message box to prove we were here
                message = "The cache is in use and cannot be cleared.  It will attempt again next time Visual Studio is restarted.";
                ScriptGenAssemblyCache.MarkForClear();
            }
            else
            {
                message = "Cache succesfully cleared.";
            }
            txtClearResult.Text = message;

            _messageTimer.Stop();
            _messageTimer.Start();
        }
Ejemplo n.º 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>
        private void MenuItemCallback(object sender, EventArgs e)
        {
            string message;

            if (!ScriptGenAssemblyCache.ClearCache())
            {
                // Show a message box to prove we were here
                message = "The cache is in use and cannot be cleared.  It will attempt again next time Visual Studio is restarted.";
                ScriptGenAssemblyCache.MarkForClear();
            }
            else
            {
                message = "Cache succesfully cleared.";
            }
            VsShellUtilities.ShowMessageBox(
                this.ServiceProvider,
                message,
                "Clear Cache",
                OLEMSGICON.OLEMSGICON_INFO,
                OLEMSGBUTTON.OLEMSGBUTTON_OK,
                OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);
        }