/// <summary>
        /// This function is the callback used to execute a command when the a menu item is clicked.
        /// See the Initialize method to see how the menu item is associated to this function using
        /// the OleMenuCommandService service and the MenuCommand class.
        /// </summary>
        private void MenuItemCallback(object sender, EventArgs e)
        {
            var dte = (DTE)GetService(typeof(SDTE));

            var dialog = new EdmxUpdaterDialogWindow(dte);
            dialog.ShowModal();

            // Show a Message Box to prove we were here
            IVsUIShell uiShell = (IVsUIShell)GetService(typeof(SVsUIShell));

            Guid clsid = Guid.Empty;
            int result;

            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(uiShell.ShowMessageBox(
                       0,
                       ref clsid,
                       "EdmxUpdater",
                       string.Format(CultureInfo.CurrentCulture, "Inside {0}.MenuItemCallback()", this.ToString()),
                       string.Empty,
                       0,
                       OLEMSGBUTTON.OLEMSGBUTTON_OK,
                       OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
                       OLEMSGICON.OLEMSGICON_INFO,
                       0,        // false
                       out result));
        }
Exemple #2
0
        /// <summary>
        /// This function is the callback used to execute a command when the a menu item is clicked.
        /// See the Initialize method to see how the menu item is associated to this function using
        /// the OleMenuCommandService service and the MenuCommand class.
        /// </summary>
        private void MenuItemCallback(object sender, EventArgs e)
        {
            var dte = (DTE)GetService(typeof(SDTE));

            var dialog = new EdmxUpdaterDialogWindow(dte);

            dialog.ShowModal();


            // Show a Message Box to prove we were here
            IVsUIShell uiShell = (IVsUIShell)GetService(typeof(SVsUIShell));

            Guid clsid = Guid.Empty;
            int  result;

            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(uiShell.ShowMessageBox(
                                                                   0,
                                                                   ref clsid,
                                                                   "EdmxUpdater",
                                                                   string.Format(CultureInfo.CurrentCulture, "Inside {0}.MenuItemCallback()", this.ToString()),
                                                                   string.Empty,
                                                                   0,
                                                                   OLEMSGBUTTON.OLEMSGBUTTON_OK,
                                                                   OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
                                                                   OLEMSGICON.OLEMSGICON_INFO,
                                                                   0, // false
                                                                   out result));
        }