private void RClickGoal(object sender, EventArgs e) { BlockMenuItem menu = sender as BlockMenuItem; if (menu == 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(GoalsView)) { if (((GoalsView)ext.Shell).UserID == View.UserID && ((GoalsView)ext.Shell).ProjectID == View.ProjectID) { ext.BringToFront(); return; } } } } // switch to goal view GoalsView view = new GoalsView(View.UI, View.Plans, View.UserID, View.ProjectID); view.LoadIdent = menu.Goal.Ident; view.LoadBranch = menu.Goal.BranchUp; view.UI.ShowView(view, view.External != null); }
private void RClickView(object sender, EventArgs e) { BlockMenuItem menu = sender as BlockMenuItem; if (menu == null) { return; } EditBlock form = new EditBlock(BlockViewMode.Show, View, menu.Block); form.ShowDialog(View); }
private void RClickEdit(object sender, EventArgs e) { BlockMenuItem menu = sender as BlockMenuItem; if (menu == null) { return; } EditBlock form = new EditBlock(BlockViewMode.Edit, View, menu.Block); if (form.ShowDialog(View) == DialogResult.OK) { View.RefreshRows(); View.ChangesMade(); } }
private void RClickDelete(object sender, EventArgs e) { BlockMenuItem menu = sender as BlockMenuItem; if (menu == null) { return; } if (View.Plans.LocalPlan.Blocks.ContainsKey(View.ProjectID)) { View.Plans.LocalPlan.Blocks[View.ProjectID].Remove(menu.Block); } View.RefreshRows(); View.ChangesMade(); }