private void PlanList_MouseDoubleClick(object sender, MouseEventArgs e) { PlanListItem item = PlanList.GetItemAt(e.Location) as PlanListItem; if (item == null) { return; } if (Selected == null) { return; } bool local = (Selected.Person == Core.UserID); EditItemMode mode = local ? EditItemMode.Edit : EditItemMode.View; EditPlanItem form = new EditPlanItem(mode, Selected, item.Item); if (form.ShowDialog(this) == DialogResult.OK) { if (local) { View.ChangesMade(); } } }
void Plan_View(object sender, EventArgs e) { PlanMenuItem menu = sender as PlanMenuItem; if (menu == null) { return; } EditPlanItem form = new EditPlanItem(EditItemMode.View, Selected, menu.Item); form.ShowDialog(this); }
private void AddItemLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { PlanItem item = new PlanItem(); item.Ident = Head.Ident; item.Project = Head.Project; item.BranchUp = Selected.BranchDown; //item.Start = Core.TimeNow.ToUniversalTime(); //item.End = Selected.End; EditPlanItem form = new EditPlanItem(EditItemMode.New, Selected, item); if (form.ShowDialog(this) == DialogResult.OK) { Plans.LocalPlan.AddItem(form.Editing); View.ChangesMade(); } }
void Plan_Edit(object sender, EventArgs e) { PlanMenuItem menu = sender as PlanMenuItem; if (menu == null) { return; } if (Selected == null) { return; } EditPlanItem form = new EditPlanItem(EditItemMode.Edit, Selected, menu.Item); if (form.ShowDialog(this) == DialogResult.OK) { View.ChangesMade(); } }
void Plan_View(object sender, EventArgs e) { PlanMenuItem menu = sender as PlanMenuItem; if (menu == null) return; EditPlanItem form = new EditPlanItem(EditItemMode.View, Selected, menu.Item); form.ShowDialog(this); }
void Plan_Edit(object sender, EventArgs e) { PlanMenuItem menu = sender as PlanMenuItem; if (menu == null) return; if (Selected == null) return; EditPlanItem form = new EditPlanItem(EditItemMode.Edit, Selected, menu.Item); if (form.ShowDialog(this) == DialogResult.OK) View.ChangesMade(); }
private void PlanList_MouseDoubleClick(object sender, MouseEventArgs e) { PlanListItem item = PlanList.GetItemAt(e.Location) as PlanListItem; if (item == null) return; if (Selected == null) return; bool local = (Selected.Person == Core.UserID); EditItemMode mode = local ? EditItemMode.Edit : EditItemMode.View; EditPlanItem form = new EditPlanItem(mode, Selected, item.Item); if (form.ShowDialog(this) == DialogResult.OK) if(local) View.ChangesMade(); }