private void CreateDynamicConnectorEdges(VA.DOM.ShapeList shape_nodes, MG.GeometryGraph msagl_graph) { // CREATE EDGES foreach (var i in msagl_graph.Edges) { var layoutconnector = (DGMODEL.Connector)i.UserData; var vconnector = new VA.DOM.Connector( layoutconnector.From.DOMNode, layoutconnector.To.DOMNode, "Dynamic Connector", "connec_u.vss"); layoutconnector.DOMNode = vconnector; shape_nodes.Add(vconnector); } var edge_pairs = from n in msagl_graph.Edges let lc = (DGMODEL.Connector)n.UserData select new { msagl_edge = n, layout_connector = lc, vconnector = (VA.DOM.Connector)lc.DOMNode }; foreach (var i in edge_pairs) { int con_route_style = (int)ConnectorTypeToCellVal_Appearance(i.layout_connector.ConnectorType); int shape_route_style = (int)ConnectorTypeToCellVal_Style(i.layout_connector.ConnectorType); i.vconnector.Text = new VA.Text.Markup.TextElement(i.layout_connector.Label); i.vconnector.Cells = i.layout_connector.Cells != null? i.layout_connector.Cells.ShallowCopy() : new VA.DOM.ShapeCells(); i.vconnector.Cells.ConLineRouteExt = con_route_style; i.vconnector.Cells.ShapeRouteStyle = shape_route_style; } }
private void CreateDynamicConnectorEdges(DOM.ShapeList shape_nodes, MG.Core.Layout.GeometryGraph mg_graph) { // CREATE EDGES foreach (var edge in mg_graph.Edges) { var ud = (NodeUserData)edge.UserData; var layout_connector = ud.Connector; VisioAutomation.DOM.Connector vconnector; if (layout_connector.MasterName != null && layout_connector.StencilName != null) { vconnector = new VA.DOM.Connector( layout_connector.From.DOMNode, layout_connector.To.DOMNode, layout_connector.MasterName, layout_connector.StencilName); } else { vconnector = new VA.DOM.Connector( layout_connector.From.DOMNode, layout_connector.To.DOMNode, "Dynamic Connector", "connec_u.vss"); } layout_connector.DOMNode = vconnector; shape_nodes.Add(vconnector); } foreach (var edge in mg_graph.Edges) { var ud = (NodeUserData)edge.UserData; var layoutconnector = ud.Connector; var vconnector = (DOM.Connector)layoutconnector.DOMNode; int con_route_style = (int)this.ConnectorTypeToCellVal_Appearance(layoutconnector.ConnectorType); int shape_route_style = (int)this.ConnectorTypeToCellVal_Style(layoutconnector.ConnectorType); vconnector.Text = new Text.Markup.TextElement(layoutconnector.Label); vconnector.Cells = layoutconnector.Cells != null? layoutconnector.Cells.ShallowCopy() : new DOM.ShapeCells(); vconnector.Cells.ConLineRouteExt = con_route_style; vconnector.Cells.ShapeRouteStyle = shape_route_style; } }