AppVeyor.Commands.ShowAppVeyorWindowCommand.OnExecute C# (CSharp) Method

OnExecute() private static method

private static OnExecute ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private static void OnExecute(object sender, EventArgs e)
        {
            try
            {
                ToolWindowPane window = AppVeyorPackage.ToolWindow;
                if ((window == null) || (window.Frame == null))
                {
                    throw new COMException("Cannot create toolwindow");
                }

                IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;
                ErrorHandler.ThrowOnFailure(windowFrame.Show());
                Telemetry.Instance.TrackEvent("Toolwindow opened from menu");
            }
            catch (Exception exception)
            {
                Telemetry.Instance.TrackException(exception);
                MessageBox.Show("Sorry, Unable to open AppVeyor window.", "AppVeyor Extension for Visual Studio",
                    MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }