Пример #1
0
        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;
        }
Пример #2
0
        private void GoalTree_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            GoalNode node = GoalTree.GetNodeAt(e.Location) as GoalNode;

            if (node == null)
            {
                return;
            }

            bool         owned    = IsOwned(node);
            EditGoalMode editMode = owned ? EditGoalMode.Edit : EditGoalMode.View;

            EditGoal form = new EditGoal(editMode, View, node.Goal);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                if (owned)
                {
                    View.ChangesMade();
                }
            }
        }