/// <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 async void Execute(object sender, EventArgs e) { await this.package.JoinableTaskFactory.SwitchToMainThreadAsync(default(CancellationToken)); DTE2 dte = await this.ServiceProvider.GetServiceAsync(typeof(DTE)) as DTE2; ToolWindowPane pane = this.package.FindToolWindow(typeof(WDotykCmd), 0, true); WDotykCmdControl wDotyk = pane.Content as WDotykCmdControl; // Show ToolWindow.OoutputWindow if (dte.Solution.Count != 0) { if (dte.Solution.Projects.Count != 0) { if (!string.IsNullOrEmpty(wDotyk.PackProj.Text)) { OutputsWindow.outputPane.Clear(); PackageOption packageOption = new PackageOption() { Configuration = wDotyk.PackConf.Text, LogVerbosity = (LogLevel)Enum.Parse(typeof(LogLevel), wDotyk.PackVerb.SelectedValue.ToString()), Project = wDotyk.PackProj.Text, Output = wDotyk.PackOutp.Text + wDotyk.PackFileName.Text + @".package.zip", Solution = wDotyk.solution }; try { var a = OutputsWindow.outputPane.Activate(); await packageOption.ExecuteAsync(); } catch (Exception ex) { Debug.Write(ex.Message); } } else { MessageBox.Show("field \"ProjectPath\" is required"); } } else { MessageBox.Show("No Project"); } } else { MessageBox.Show("No Solution"); } }
/// <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 async void Execute(object sender, EventArgs e) { await this.package.JoinableTaskFactory.SwitchToMainThreadAsync(); DTE2 dte = await this.ServiceProvider.GetServiceAsync(typeof(DTE)) as DTE2; ToolWindowPane pane = this.package.FindToolWindow(typeof(WDotykCmd), 0, true); WDotykCmdControl wDotyk = pane.Content as WDotykCmdControl; if (dte.Solution.Count != 0) if (dte.Solution.Projects.Count != 0) { if (!string.IsNullOrEmpty(wDotyk.PushPackage.Text)) { PushOption pushOption = new PushOption() { Register = true, ServerUrl = wDotyk.PushServer.Text, LogVerbosity = (LogLevel)Enum.Parse(typeof(LogLevel), wDotyk.PushVerb.SelectedValue.ToString()), PackagePath = wDotyk.PushPackage.Text,//packagePath, Feed = /*Store.Model.*/PackageFeed.Test, DotykMeToken = wDotyk.PushToken.Text, UseDotykMe = true }; try { OutputsWindow.outputPane.Activate(); await pushOption.ExecuteAsync(); } catch (Exception ex) { Debug.Write(ex.Message); } } else MessageBox.Show("field \"ProjectPath\" is required"); } else { MessageBox.Show("No Project"); } else { MessageBox.Show("No Solution"); } }