Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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();
            }
        }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
        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();
        }