private async void PushButton_Click(object sender, RoutedEventArgs e) { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); PushOption pushOption = new PushOption() { Register = checkBoxRegister.IsChecked ?? false, ServerUrl = textBoxServer.Text, LogVerbosity = (LogLevel)Enum.Parse(typeof(LogLevel), comboBoxVerb.SelectedValue.ToString()), PackagePath = packagePath,//packagePath, Feed = /*Store.Model.*/ PackageFeed.Test, DotykMeToken = textBoxAuthToken.Text, UseDotykMe = true }; try { OutputsWindow.outputPane.Activate(); await PushAsync(pushOption); } catch (Exception ex) { MessageBox.Show("error: " + ex.Message); } }
private static async Task PushAsync(PushOption pushOption) { try { await pushOption.ExecuteAsync(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }