Example #1
0
 private void ObjectSingleClicked(object sender, GoObjectEventArgs e)
 {
     if (e.GoObject.ParentNode is RoadmapItem mitigation)
     {
         _itemDetails.Item = mitigation.Mitigation;
         LoadGrid(mitigation.Mitigation);
     }
 }
Example #2
0
        private void goView1_ObjectDoubleClicked(object sender, GoObjectEventArgs e)
        {
            GoBasicNode bn           = e.GoObject.ParentNode as GoBasicNode;
            string      seletedLotID = bn.Text.Split('\n')[0].Trim();

            seletedLotID = seletedLotID.Split(':')[1].Trim();
            DrawingLotPath(seletedLotID);
        }
Example #3
0
        private void onDoubleClicked(GoObjectEventArgs e)
        {
            var journalPageNode = e.GoObject?.ParentNode as JournalPageNode;

            if (journalPageNode == null)
            {
                return;
            }

            _journalDiagramPresenter.EditJournalPage(journalPageNode);
        }
Example #4
0
        protected override void OnContextClicked(GoObjectEventArgs e)
        {
            var nodes = _goView.Selection.All().ToList();

            if (nodes.All(x => x.IsAnImplementationOf <IBaseNode>()))
            {
                _journalDiagramPresenter.ShowContextMenu(nodes.Cast <IBaseNode>().ToList(), e.ViewPoint);
            }
            else
            {
                base.OnContextClicked(e);
            }
        }
Example #5
0
        private void goView1_ObjectDoubleClicked(object sender, GoObjectEventArgs e)
        {
            setStatus(false);
            GoBasicNode node = e.GoObject.TopLevelObject as GoBasicNode;

            if (node != null)
            {
                createZedgraph(node);
            }
            else
            {
                setStatus(true);
            }
        }
        private void onDoubleClicked(GoObjectEventArgs e)
        {
            if (e.GoObject == null)
            {
                return;
            }
            var baseNode = e.GoObject as IBaseNode;

            if (baseNode == null && e.GoObject.Parent != null)
            {
                baseNode = e.GoObject.Parent as IBaseNode;
            }
            if (baseNode == null)
            {
                return;
            }
            _moBiDiagramPresenter.ModelSelect(baseNode.Id);
        }
Example #7
0
        protected virtual void OnContextClicked(GoObjectEventArgs e)
        {
            if (e.GoObject == null)
            {
                return;
            }
            var baseNode = e.GoObject as IBaseNode;

            if (baseNode == null && e.GoObject.Parent != null)
            {
                baseNode = e.GoObject.Parent as IBaseNode;
            }
            if (baseNode == null)
            {
                return;
            }

            _presenter.ShowContextMenu(baseNode, e.ViewPoint, e.DocPoint);
        }
Example #8
0
        private void onSingleClicked(GoObjectEventArgs e)
        {
            var containerBaseHandle = e.GoObject as GoSubGraphHandle;
            var containerBaseNode   = containerBaseHandle?.Parent as IContainerNode;

            if (containerBaseNode == null)
            {
                return;
            }

            // keep original Expansion state
            bool containerBaseNodeIsExpanded = containerBaseNode.IsExpanded;

            try
            {
                if (e.Control && containerBaseNode.IsExpanded)
                {
                    containerBaseNode.Collapse(100); // collapse recursively
                }
                if (!e.Control && !e.Shift)          // collapse and show other/ expand and hide other
                {
                    if (containerBaseNode.IsExpanded)
                    {
                        Presenter.Unfocus(containerBaseNode);
                    }
                    else
                    {
                        if (!containerBaseNode.IsExpandedByDefault)
                        {
                            Presenter.HideAll();
                        }
                        Presenter.Focus(containerBaseNode);
                    }
                }
            }
            finally
            {
                containerBaseNode.IsExpanded = containerBaseNodeIsExpanded; // because Default Action for GoSubGraphHandle is performed afterwards
            }
        }
Example #9
0
        private async void ObjectSingleClicked(object sender, GoObjectEventArgs e)
        {
            if (e.GoObject.ParentNode is KanbanItem item)
            {
                _itemDetails.Item = item.Item;

                _comments.Clear();

                if (item.Item is IThreatModelChild child && child.Model != null && item.Item is IMitigation mitigation)
                {
                    var connector = DevOpsManager.GetConnector(child.Model);
                    IEnumerable <Comment> comments = null;
                    var itemId = item.DevOpsId;
                    if (itemId > 0)
                    {
                        comments = (await connector.GetWorkItemCommentsAsync(itemId))?.ToArray();
                    }
                    else
                    {
                        comments = (await connector.GetWorkItemCommentsAsync(mitigation))?.ToArray();
                    }

                    if (comments?.Any() ?? false)
                    {
                        var myself = UserName.GetDisplayName();

                        foreach (var comment in comments)
                        {
                            _comments.AddComment(comment.Author, comment.Text, comment.Timestamp,
                                                 string.CompareOrdinal(myself, comment.Author) == 0);
                        }
                    }

                    LoadGrid(mitigation);
                }

                _comments.RefreshNodes();
            }
        }
        private void d_ObjectSingleClicked(object sender, GoObjectEventArgs e)
        {
            
            GoObject clickedObject = e.GoObject;

            if (clickedObject.ParentNode != null && clickedObject.ParentNode is HasNodeID)
            {
                int newSelected = ((HasNodeID)clickedObject.ParentNode).NodeID;

                //createInstanceTree.ClearSelection();
                customTreeView2.ClearSelection();
                createInstanceTree.DoNewSelectionWithID(newSelected, myLinkType);
                customTreeView2.DoNewSelectionWithID(newSelected, myLinkType);
                string name = vsgController.GetComponentName(newSelected);

                switch (name)
                {
                    case "RevealEvent":
                        Show_Properties(EventProperties.Reveal, newSelected, -1);
                        break;
                    case "MoveEvent":
                        Show_Properties(EventProperties.Move, newSelected, -1);
                        break;
                    case "LaunchEvent":
                        Show_Properties(EventProperties.Launch, newSelected, -1);
                        break;
                    case "WeaponLaunchEvent":
                        Show_Properties(EventProperties.WeaponLaunch, newSelected, -1);
                        break;
                    default:
                        break;
                }
            }
        }
        private void d_ObjectSingleClicked(object sender, GoObjectEventArgs e)
        {
            GoObject clickedObject = e.GoObject;

            if (clickedObject.ParentNode != null && clickedObject.ParentNode is HasNodeID)
            {
                DrawingUtility.SuspendDrawing(panelRegion);

                Int32 newSelected = ((HasNodeID)clickedObject.ParentNode).NodeID;
                String newSelectedName = vsgController.GetComponentName(newSelected);
                customTabPage3.Description = newSelectedName + " Properties";

                customTreeView1.DoNewSelectionWithID(newSelected, myLinkType);

                showRegionPanel(newSelected);

                textBoxLRVertexList.ComponentId = newSelected;
                textBoxLRVertexList.UpdateViewComponent();
                textBoxARStart.ComponentId = newSelected;
                textBoxAREnd.ComponentId = newSelected;
                checkBoxARBlocksMovement.ComponentId = newSelected;
                checkBoxARIsVisible.ComponentId = newSelected;
                enumBoxARColor.ComponentId = newSelected;
                linkBoxARSensorsBlocked.DisplayRootId = vsgController.ScenarioId;
                linkBoxARSensorsBlocked.ConnectRootId = newSelected;
                linkBoxARSensorsBlocked.ConnectFromId = newSelected;
                if (!panelLandRegion.Visible)
                {
                    textBoxARSpeedMultiplier.ComponentId = newSelected;
                    textBoxActiveRegionRelativeVertexList.ComponentId = newSelected;
                    textBoxARVertexList.ComponentId = newSelected;
                    textBoxReferencePoint.ComponentId = newSelected;
                    checkBoxDynamicRegion.ComponentId = newSelected;
                    textBoxARSpeedMultiplier.UpdateViewComponent();
                    textBoxActiveRegionRelativeVertexList.UpdateViewComponent();
                    textBoxARVertexList.UpdateViewComponent();
                    textBoxReferencePoint.UpdateViewComponent();
                    checkBoxDynamicRegion.UpdateViewComponent();
                }
                

                
                textBoxARStart.UpdateViewComponent();
                textBoxAREnd.UpdateViewComponent();
                checkBoxARBlocksMovement.UpdateViewComponent();
                checkBoxARIsVisible.UpdateViewComponent();
                enumBoxARColor.UpdateViewComponent();
                linkBoxARSensorsBlocked.UpdateViewComponent();

                DrawingUtility.ResumeDrawing(panelRegion);
            }
        }
Example #12
0
        private void Diagram_ObjectSingleClicked(object sender, GoObjectEventArgs e)
        {
            if (this.ContextMenuStrip == null)
            {
                this.ContextMenuStrip = new ContextMenuStrip();
            }
            else
            {
                this.ContextMenuStrip.Items.Clear();
            }

            // right click on inside of poly adds points
            if (e.GoObject is DiagramPolygon && e.Buttons == MouseButtons.Right)
            {
                DiagramPolygon cast = (DiagramPolygon)e.GoObject;
                List<PointF> points = cast.GetPoints();

                Boolean deleteFound = false;
                remove = -1;
                intersect = -1; //checked in add/delete function calls

                for (int i = 0; i < points.Count; i++)
                {
                    PointF point = points[i];

                    if (Math.Abs(point.X - e.DocPoint.X) <= 10 && Math.Abs(point.Y - e.DocPoint.Y) <= 10)
                    {
                        deleteFound = true;
                        remove = i;
                        ToolStripItem item = ContextMenuStrip.Items.Add("Delete this point");
                        item.Click += new EventHandler(deletePoint);
                        break;
                    }
                }

                if (!deleteFound)
                {
                    polygonClicked = e.DocPoint;
                    intersect = cast.GetSegmentNearPoint(polygonClicked, 10);
                    if (intersect != -1)
                    {
                        ToolStripItem item = ContextMenuStrip.Items.Add("Add point here");
                        item.Click += new EventHandler(addPoint);
                    }
                }

                ContextMenuStrip.Show(Cursor.Position.X, Cursor.Position.Y);
                ContextMenuStrip.Closed += new ToolStripDropDownClosedEventHandler(ContextMenuStrip_Closed);
            }
        }