void Goal_Schedule(object sender, EventArgs e) { GoalMenuItem item = sender as GoalMenuItem; if (item == null) { return; } if (View.External != null && View.UI.GuiMain.GetType() == typeof(MainForm)) { foreach (ExternalView ext in ((MainForm)View.UI.GuiMain).ExternalViews) { if (ext.Shell.GetType() == typeof(ScheduleView)) { if (((ScheduleView)ext.Shell).UserID == View.UserID && ((ScheduleView)ext.Shell).ProjectID == View.ProjectID) { ext.BringToFront(); return; } } } } ScheduleView view = new ScheduleView(View.UI, Plans, View.UserID, View.ProjectID); view.LoadGoal = item.Goal.Ident; view.LoadGoalBranch = item.Goal.BranchUp; view.UI.ShowView(view, View.External != null); }
void Goal_View(object sender, EventArgs e) { GoalMenuItem item = sender as GoalMenuItem; if (item == null) { return; } EditGoal form = new EditGoal(EditGoalMode.View, View, item.Goal); form.ShowDialog(this); }
void Goal_Edit(object sender, EventArgs e) { GoalMenuItem item = sender as GoalMenuItem; if (item == null) { return; } EditGoal form = new EditGoal(EditGoalMode.Edit, View, item.Goal); if (form.ShowDialog(this) == DialogResult.OK) { View.ChangesMade(); } }
void Goal_Archive(object sender, EventArgs e) { GoalMenuItem item = sender as GoalMenuItem; if (item == null) { return; } DialogResult result = MessageBox.Show(this, "Are you sure you want to archive:\n" + item.Goal.Title + "?", "DeOps", MessageBoxButtons.YesNo); if (result == DialogResult.No) { return; } item.Goal.Archived = true; // signal update View.ChangesMade(); }
void Goal_Delete(object sender, EventArgs e) { GoalMenuItem item = sender as GoalMenuItem; if (item == null) { return; } DialogResult result = MessageBox.Show(this, "Are you sure you want to delete:\n" + item.Goal.Title + "?", "DeOps", MessageBoxButtons.YesNo); if (result == DialogResult.No) { return; } Plans.LocalPlan.RemoveGoal(item.Goal); // signal update View.ChangesMade(); }