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); }
void Menu_GoalsView(object sender, EventArgs args) { IViewParams node = sender as IViewParams; if (node == null) { return; } var view = new GoalsView(UI, Plan, node.GetUser(), node.GetProject()); UI.ShowView(view, node.IsExternal()); }
public EditGoal(EditGoalMode mode, GoalsView view, PlanGoal editing) { InitializeComponent(); Mode = mode; View = view; Core = View.Core; Editing = editing; if (Mode == EditGoalMode.New) { Text = "New Goal"; PersonLabel.Visible = false; PickLink.Visible = false; } if (Mode == EditGoalMode.Delgate) { Text = "Delegate Responsibility"; } if (Mode == EditGoalMode.View) { Text = editing.Title; TitleBox.ReadOnly = true; Deadline.Enabled = false; PickLink.Enabled = false; NotesInput.ReadOnly = true; } if (Mode == EditGoalMode.Edit) { Text = "Edit Goal"; } TitleBox.Text = Editing.Title; Deadline.Value = Editing.End.ToLocalTime(); SetPerson(Editing.Person); NotesInput.InputBox.Text = Editing.Description; }
public void Init(GoalsView view) { View = view; Core = View.Core; Plans = view.Plans; Trust = Core.Trust; GoalTree.NodeExpanding += new EventHandler(GoalTree_NodeExpanding); GoalTree.NodeCollapsed += new EventHandler(GoalTree_NodeCollapsed); GoalTree.ControlPadding = 3; GoalTree.SmallImageList = new List <Image>(); GoalTree.SmallImageList.Add(new Bitmap(16, 16)); GoalTree.SmallImageList.Add(PlanRes.star); GoalTree.SmallImageList.Add(PlanRes.high_goal); GoalTree.SmallImageList.Add(PlanRes.low_goal); DelegateLink.Hide(); AddItemLink.Hide(); }