private async void LinkCreated(object sender, GoSelectionEventArgs e) { var link = e.GoObject as GoLabeledLink; if (link != null) { InputForm form = new InputForm(); Enabled = false; form.Show(); bool cont = false; Action <object, EventArgs> act = (o, ea) => { link.MidLabel = new GoText { Text = form.inputBox.Text }; link.UserFlags = int.Parse(form.inputBox.Text); link.UserObject = new object(); cont = true; Enabled = true; form.Close(); }; form.OKbutton.Click += new EventHandler(act); while (!cont) { await Task.Delay(10); } } }
protected void NodeLostSelection(Object sender, GoSelectionEventArgs evt) { if (this.View.Selection.Primary == null) { this.NodeInfo = null; } }
private void _graph_LinkCreated(object sender, GoSelectionEventArgs e) { if (e.GoObject is GraphLink glink) { glink.DpiState = _dpiState; if (glink.Parent is GraphGroup group) { group.Remove(glink); } _graph.Doc.LinksLayer.Add(glink); if (glink.FromPort.Node is GraphEntity from && glink.ToPort.Node is GraphEntity to) { var link = CreateLink(glink, from, to); if (link != null) { glink.Link = link; _links[link.AssociatedId] = glink; } } if (_actions != null) { glink.SetContextAwareActions(_actions); } glink.SelectedLink += OnSelectedLink; glink.SelectedThreatEvent += OnSelectedThreatEvent; } }
private void _graph_ObjectLostSelection(object sender, GoSelectionEventArgs e) { if (!_loading && _graph.Selection.Count == 0) { _properties.Item = _diagram; OnObjectSelected(false); } }
protected override void OnObjectLostSelection(GoSelectionEventArgs e) { base.OnObjectLostSelection(e); if (myPrimarySelection != this.Selection.Primary) { myPrimarySelection = this.Selection.Primary; } }
protected override void OnObjectGotSelection(GoSelectionEventArgs evt) { base.OnObjectGotSelection(evt); if (myPrimarySelection != this.Selection.Primary) { myPrimarySelection = this.Selection.Primary; //frmMDI.App.EnableToolBarEditButtons(this); } }
protected override void OnObjectLostSelection(GoSelectionEventArgs evt) { base.OnObjectLostSelection(evt); if (myPrimarySelection != this.Selection.Primary) { myPrimarySelection = this.Selection.Primary; //MainForm.App.EnableToolStripEditButtons(this); } }
private void onLinkCreated(GoSelectionEventArgs e) { var link = (NewLink)e.GoObject; var node1 = (IBaseNode)link.FromNode; var node2 = (IBaseNode)link.ToNode; var portObject1 = link.FromPort.UserObject; var portObject2 = link.ToPort.UserObject; _moBiDiagramPresenter.Link(node1, node2, portObject1, portObject2); _goView.Document.Remove(link); }
private void onLinkCreated(GoSelectionEventArgs e) { var link = (NewLink)e.GoObject; var node1 = (IBaseNode)link.FromNode; var node2 = (IBaseNode)link.ToNode; var parentNode = getParentNodeFromLink(link); var childNode = parentNode == node1 ? node2 : node1; _journalDiagramPresenter.AddParentLink(childNode, parentNode); _goView.Document.Remove(link); }
private void selected(object sender, GoSelectionEventArgs e) { var node = e.GoObject as RouterNode; if (node == null) { return; } neighborTable.DataSource = node.NeighborhoodTable; topologyTable.DataSource = node.TopologyTable; routingTable.DataSource = node.RoutingTable; }
protected void NodeGotSelection(Object sender, GoSelectionEventArgs evt) { if (evt.GoObject == this.View.Selection.Primary) { IGoNode n = evt.GoObject as IGoNode; if (n != null && n.UserObject != null) { this.NodeInfo = (n.UserObject as ToolBase).Settings; } else { this.NodeInfo = null; } } }
private void _graph_ObjectGotSelection(object sender, GoSelectionEventArgs e) { if (!_loading) { if (_graph.Selection.Count == 1 && e.GoObject is GraphText graphText) { if (graphText.Parent is GraphLink link) { _properties.Item = link.Link.DataFlow; } else { _properties.Item = _diagram; } } OnObjectSelected(_graph.Selection.Count > 0); } }
private void deselected(object sender, GoSelectionEventArgs e) { }
private void GraphView_LinkCreated(object sender, GoSelectionEventArgs e) { GoLink link = (GoLink)e.GoObject; DiagramNode to = (DiagramNode)link.ToNode; DiagramNode from = (DiagramNode)link.FromNode; this.Document.Remove(link); try { this.myController.Connect(this.RootID, from.NodeID, to.NodeID, DiagramName); } catch (Exception ex) { MessageBox.Show(ex.Message, "Unable to create link", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void Diagram_LinkRelinked(object sender, GoSelectionEventArgs e) { myController.TurnViewUpdateOff(); DiagramLink link = (DiagramLink)e.GoObject; this.Document.Remove(link); DiagramNode to = (DiagramNode)link.ToNode; DiagramNode from = (DiagramNode)link.FromNode; if (this.Tool is GoToolRelinking) { GoToolRelinking castTool = (GoToolRelinking)this.Tool; GoPort start, end; if (castTool.Forwards) { start = (GoPort)castTool.OriginalStartPort; end = (GoPort)castTool.OriginalEndPort; } else { //swap start = (GoPort)castTool.OriginalEndPort; end = (GoPort)castTool.OriginalStartPort; } DiagramNode startNode = (DiagramNode)start.Node; DiagramNode endNode = (DiagramNode)end.Node; try { // record the relink in the database this.myController.Connect(this.RootID, from.NodeID, to.NodeID, DiagramName); // and remove the old link this.Controller.DeleteLink(link.LinkID); } catch (Exception ex) { MessageBox.Show(ex.Message, "Unable to create link", MessageBoxButtons.OK, MessageBoxIcon.Warning); // the old link was removed from the display on the unsuccessful relink // recreate it (it's still in the db, but this is more efficient) DiagramLink newLink = new DiagramLink(); newLink.ToArrow = true; newLink.FromPort = startNode.Port; newLink.ToPort = endNode.Port; this.Document.Add(newLink); } } myController.TurnViewUpdateOn(); }
private void Diagram_ObjectResized(object sender, GoSelectionEventArgs e) { this.StopAutoScroll(); // from DiagramPolygon resizingevent GoObject test = e.GoObject; if (test is DiagramPolygon) { DiagramPolygon poly = (DiagramPolygon)test; this.Controller.UpdateParameters(poly.NodeID, poly.ParameterName, poly.GetPointString(), eParamParentType.Component); } }
private void event1(object sender, GoSelectionEventArgs e) { }