Example #1
0
        /// <summary>
        /// Bring up a FlowBlock specific context menu.
        /// </summary>
        /// <param name="evt"></param>
        /// <param name="view"></param>
        /// <returns></returns>
        public override GoContextMenu GetContextMenu(GoView view)
        {
            if (view is GoOverview)
            {
                return(null);
            }
            if (!(view.Document is FlowDocument))
            {
                return(null);
            }
            GoContextMenu cm = new GoContextMenu(view);

            if (!((FlowDocument)view.Document).IsReadOnly && this.IsPredecessor)
            {
                cm.MenuItems.Add(new MenuItem("Draw Link", new EventHandler(this.DrawRelationship_Command)));
                cm.MenuItems.Add(new MenuItem("-"));
            }
            if (CanDelete())
            {
                cm.MenuItems.Add(new MenuItem("Cut", new EventHandler(this.Cut_Command)));
            }
            if (CanCopy())
            {
                cm.MenuItems.Add(new MenuItem("Copy", new EventHandler(this.Copy_Command)));
            }
            if (CanDelete())
            {
                cm.MenuItems.Add(new MenuItem("Delete", new EventHandler(this.Delete_Command)));
            }

            return(cm);
        }
Example #2
0
        public override GoContextMenu GetContextMenu(GoView view)
        {
            if (view is GoOverview)
            {
                return(null);
            }
            var cm = new GoContextMenu(view);

            if (_buckets?.Any() ?? false)
            {
                bool first = true;
                foreach (var bucket in _buckets)
                {
                    if (first)
                    {
                        first = false;
                    }
                    else
                    {
                        cm.MenuItems.Add(new MenuItem("-"));
                    }
                    AddMenu(cm, _actions[bucket]);
                }
            }

            return(cm);
        }
Example #3
0
        private void AddMenu([NotNull] GoContextMenu menu, [NotNull] List <IContextAwareAction> actions)
        {
            bool separator = false;

            foreach (var action in actions)
            {
                if (action.IsVisible(_diagram))
                {
                    if (!separator)
                    {
                        separator = true;

                        if (menu.MenuItems.Count > 0)
                        {
                            menu.MenuItems.Add(new MenuItem("-"));
                        }
                    }

                    menu.MenuItems.Add(new MenuItem(action.Label, DoAction)
                    {
                        Tag = action
                    });
                }
            }
        }
Example #4
0
        public void Copy_Command(Object sender, EventArgs e)
        {
            GoView v = GoContextMenu.FindView(sender as ToolStripMenuItem);

            if (v != null)
            {
                v.EditCopy();
            }
        }
Example #5
0
        public void Delete_Command(Object sender, EventArgs e)
        {
            GoView v = GoContextMenu.FindView(sender as MenuItem);

            if (v != null)
            {
                v.EditDelete();
            }
        }
Example #6
0
 private void AddMenu([NotNull] GoContextMenu menu, [NotNull] List <IContextAwareAction> actions)
 {
     foreach (var action in actions)
     {
         menu.MenuItems.Add(new MenuItem(action.Label, DoAction)
         {
             Tag = action
         });
     }
 }
Example #7
0
        public void DrawRelationship_Command(Object sender, EventArgs e)
        {
            GoView v = GoContextMenu.FindView(sender as ToolStripMenuItem);

            if (v != null)
            {
                //RelationshipTool t = new RelationshipTool(v);
                //t.Predecessor = this;
                //v.Tool = t;
            }
        }
Example #8
0
        public void DrawRelationship_Command(Object sender, EventArgs e)
        {
            GoView v = GoContextMenu.FindView(sender as MenuItem);

            if (v != null)
            {
                linkTool t = new linkTool(v);
                t.Predecessor = this;
                v.Tool        = t;
            }
        }
Example #9
0
 /// <summary>
 /// Bring up a context menu when the user context clicks in the background.
 /// </summary>
 /// <param name="evt"></param>
 protected override void OnBackgroundContextClicked(GoInputEventArgs e)
 {
     base.OnBackgroundContextClicked(e);
     // set up the background context menu
     GoContextMenu cm = new GoContextMenu(this);
     if (CanInsertObjects())
         cm.MenuItems.Add(new MenuItem("Paste", new EventHandler(this.Paste_Command)));
     if (cm.MenuItems.Count > 0)
         cm.MenuItems.Add(new MenuItem("-"));
     cm.MenuItems.Add(new MenuItem("Properties", new EventHandler(this.Properties_Command)));
     cm.Show(this, e.ViewPoint);
 }
Example #10
0
        public override GoContextMenu GetContextMenu(GoView view)
        {
            if (view is GoOverview)
            {
                return(null);
            }
            var result = new GoContextMenu(view);

            result.MenuItems.Add(new MenuItem("Associate to DevOps object", AssociateToDevOps));

            return(result);
        }
Example #11
0
        protected override void OnBackgroundContextClicked(GoInputEventArgs evt)
        {
            base.OnBackgroundContextClicked(evt);
            GoContextMenu cm = new GoContextMenu(this);

            if (_buckets?.Any() ?? false)
            {
                foreach (var bucket in _buckets)
                {
                    AddMenu(cm, _actions[bucket]);
                }
            }
            cm.Show(this, evt.ViewPoint);
        }
Example #12
0
        /// <summary>
        /// Bring up a GraphNode specific context menu.
        /// </summary>
        /// <param name="evt"></param>
        /// <param name="view"></param>
        /// <returns></returns>
        public override GoContextMenu GetContextMenu(GoView view)
        {
            if (view is GoOverview)
            {
                return(null);
            }
            if (!(view.Document is GraphDoc))
            {
                return(null);
            }
            GoContextMenu cm = new GoContextMenu(view);

            cm.Items.Add(new ToolStripMenuItem("Exe", null, new EventHandler(this.Exe_Command)));
            return(cm);
        }
Example #13
0
        /// <summary>
        /// Bring up a context menu when the user context clicks in the background.
        /// </summary>
        /// <param name="evt"></param>
        protected override void OnBackgroundContextClicked(GoInputEventArgs evt)
        {
            base.OnBackgroundContextClicked(evt);
            // set up the background context menu
            GoContextMenu cm = new GoContextMenu(this);

            //if (CanInsertObjects())
            //    cm.Items.Add(new ToolStripMenuItem("Paste", null, new EventHandler(this.Paste_Command)));
            if (cm.Items.Count > 0)
            {
                cm.Items.Add(new ToolStripSeparator());
            }
            cm.Items.Add(new ToolStripMenuItem("Properties", null, new EventHandler(this.Properties_Command)));
            cm.Show(this, evt.ViewPoint);
        }
Example #14
0
 public override GoContextMenu GetContextMenu(GoView view)
 {
     GoContextMenu cm = new GoContextMenu(view);
     foreach (LINK_TYPE lt in Enum.GetValues(typeof(LINK_TYPE)))
     {
         if (lt.Equals(linkType))
         {
             cm.MenuItems.Add(
                 new Northwoods.GoWeb.MenuItem(String.Format("Set Is {0}", lt.ToString().ToUpperInvariant()),
                 new EventHandler(SetLinkType)));
         }
     }
     return cm;
 }
Example #15
0
 public override GoContextMenu GetContextMenu(GoView view)
 {
     GoContextMenu cm = new GoContextMenu(view);  
     return cm;
 }