public static DialogResult Show(P4.P4Exception ex, bool showCancel, bool suppressUI) { P4VsProviderService p4vs = (P4VsProviderService)P4VsProvider.Service(typeof(P4VsProviderService)); if ((suppressUI) && (ex.ErrorLevel < P4.ErrorSeverity.E_FATAL)) { return(DialogResult.OK); } if (p4vs.ScmProvider != null && p4vs.ScmProvider.Connection != null) { if (p4vs.ScmProvider.Connection.isLoggedIn() == false) { MessageBox.Show(Resources.P4ErrorDlg_LoggedOutMsg, Resources.P4VS, MessageBoxButtons.OK, MessageBoxIcon.Error); return(DialogResult.Cancel); } } if (ex is P4.P4CommandCanceledException) { // this command was canceled by the user, so no need to show an error. return(DialogResult.OK); } P4ErrorDlg dlg = new P4ErrorDlg(ex, showCancel); return(dlg.ShowDialog()); }
//[Import] //System.IServiceProvider ServiceManager = null; public IVsWindowFrame FindSolutionExplorerFrame() { IVsUIShell uiShell = (IVsUIShell)P4VsProvider.Service(typeof(SVsUIShell)); return(FindSolutionExplorerFrame(uiShell)); }