static public void InsertConnectedShape(SDON.Model.Shape parent, SDON.Model.Shape child) { if ((parent == null) || (child == null)) { return; } SDON.Model.ShapeConnector con; if ((parent.ShapeConnector == null) || (parent.ShapeConnector.Count == 0)) { con = new SDON.Model.ShapeConnector(); con.Direction = SDON.Model.Directions.Bottom; con.Shapes = new List <SDON.Model.Shape>(); con.DefaultShape = new SDON.Model.Shape(); con.DefaultShape.MinWidth = 151; con.DefaultShape.MinHeight = 76; con.DefaultShape.ShapeType = "Rect"; parent.ShapeConnector = new List <SDON.Model.ShapeConnector>(); parent.ShapeConnector.Add(con); } else { con = parent.ShapeConnector[0]; } con.Shapes.Add(child); }
private List <SDON.Model.Shape> findParent(int parentID) { SDON.Model.ShapeConnector con; List <SDON.Model.Shape> parent = null; if (parentID == 0) { if (_root.Shape == null) { //SHAPE ARRAY _root.Shape = new SDON.Model.Shape(); _root.Shape.Hide = true; _root.Shape.ShapeContainer = new SDON.Model.ShapeContainer(); _root.Shape.ShapeContainer.Arrangement = SDON.Model.ShapeArrangementTypes.Row; parent = new List <SDON.Model.Shape>(); _root.Shape.ShapeContainer.Shapes = parent; } else { parent = _root.Shape.ShapeContainer.Shapes; } } else { for (int i = 0; i < _nodesOnTree.Count; i++) { if (_nodesOnTree[i].Entry.EntryID == parentID) { if (_nodesOnTree[i].Shape.ShapeConnector == null) { _nodesOnTree[i].Shape.ShapeConnector = new List <SDON.Model.ShapeConnector>(); parent = new List <SDON.Model.Shape>(); con = new SDON.Model.ShapeConnector(); con.Shapes = parent; con.StartArrow = 1; con.EndArrow = 0; con.Arrangement = "Row"; _nodesOnTree[i].Shape.ShapeConnector.Add(con); } else { parent = _nodesOnTree[i].Shape.ShapeConnector[0].Shapes; } break; } } } return(parent); }
private SDON.Model.Shape generateTableWithLeaves(SDON.Model.Shape shape) { SDON.Model.Shape ret = new SDON.Model.Shape(); SDON.Model.Cell tempCell; ret.Table = new SDON.Model.Table(); ret.Table.Cell = new List <SDON.Model.Cell>(); ret.Table.Rows = 0; ret.TextMargin = 6; ret.TextGrow = SDON.Model.TextGrow.Horizontal; ret.ShapeType = "Rect"; ret.FillColor = "#F2F2F2"; ret.LineColor = "#BFBFBF"; if (shape.ShapeConnector == null) { return(null); } SDON.Model.ShapeConnector connector = shape.ShapeConnector.FirstOrDefault(); if (connector == null) { return(null); } foreach (SDON.Model.Shape child in connector.Shapes) { if (child.ShapeConnector == null) { tempCell = new SDON.Model.Cell(); tempCell.Label = child.Label; tempCell.TextAlignH = SDON.Model.HorizontalAlignments.Left; tempCell.Truncate = 72; if (_converter.GenerateHyperlinks) { tempCell.Hyperlink = new SDON.Model.Hyperlink(); tempCell.Hyperlink = child.Hyperlink; } tempCell.Row = ret.Table.Rows + 1; ret.Table.Cell.Add(tempCell); ret.Table.Rows++; } } //temp <- pretty sure this was fixed? if (_converter.GenerateHyperlinks) { ret.Hyperlink = new SDON.Model.Hyperlink(); ret.Hyperlink.url = ""; } return(ret); }