void UpdateButton_Click(object sender, RoutedEventArgs e) { var selectedMission = (Mission)DataGrid.SelectedItem; if (selectedMission == null) { return; } var mission = MainWindow.Instance.Mission; var dialog = new PublishDialog { DataContext = mission, Owner = this }; dialog.OKButton.Click += delegate { var error = mission.VerifyCanPublish(); if (error == null) { Publishing.SendMissionWithDialog(mission, dialog.PasswordBox.Password, selectedMission.MissionID); dialog.Close(); RefreshList(); } else { MessageBox.Show(error); } }; dialog.ShowDialog(); }
public static void Publish(Mission mission, int? missionID) { var dialog = new PublishDialog { DataContext = mission, Owner = MainWindow.Instance}; dialog.OKButton.Click += delegate { var error = mission.VerifyCanPublish(); if (error == null) { SendMissionWithDialog(mission, dialog.PasswordBox.Password, missionID); dialog.Close(); } else MessageBox.Show(error); }; dialog.ShowDialog(); }
public static void Publish(Mission mission, int?missionID) { var dialog = new PublishDialog { DataContext = mission, Owner = MainWindow.Instance }; dialog.OKButton.Click += delegate { var error = mission.VerifyCanPublish(); if (error == null) { SendMissionWithDialog(mission, dialog.PasswordBox.Password, missionID); dialog.Close(); } else { MessageBox.Show(error); } }; dialog.ShowDialog(); }
void UpdateButton_Click(object sender, RoutedEventArgs e) { var selectedMission = (Mission)DataGrid.SelectedItem; if (selectedMission == null) return; var mission = MainWindow.Instance.Mission; var dialog = new PublishDialog { DataContext = mission, Owner = this }; dialog.OKButton.Click += delegate { var error = mission.VerifyCanPublish(); if (error == null) { Publishing.SendMissionWithDialog(mission, dialog.PasswordBox.Password, selectedMission.MissionID); dialog.Close(); RefreshList(); } else MessageBox.Show(error); }; dialog.ShowDialog(); }