예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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();
            }
        }
예제 #4
0
        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();
        }