private void insertSectionToNode(string sectionName, SDON.Model.Table table) { SDON.Model.Cell cell = new SDON.Model.Cell(); SDON.Model.Cell auxCell = new SDON.Model.Cell(); cell.Row = table.Rows + 1; cell.Column = 1; cell.Label = sectionName; cell.TextSize = 10; cell.TextAlignH = SDON.Model.HorizontalAlignments.Left; cell.FillColor = "#EFF4F9"; cell.TextUnderline = false; cell.Truncate = 42; auxCell.Row = table.Rows + 1; auxCell.Column = 2; auxCell.TextSize = 10; auxCell.TextAlignH = SDON.Model.HorizontalAlignments.Left; auxCell.FillColor = "#EFF4F9"; auxCell.NoteIcon = "Info"; table.Cell.Add(cell); table.Cell.Add(auxCell); table.Rows++; }
private SDON.Model.Cell createCellTemplate() { SDON.Model.Cell ret = new SDON.Model.Cell(); ret.FillColor = "#FFFFFF"; //ret.Truncate = 20; ret.TextAlignH = SDON.Model.HorizontalAlignments.Left; return(ret); }
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); }
private void insertEntryToNode(Entry member, SDON.Model.Table table) { SDON.Model.Cell cell = new SDON.Model.Cell(); SDON.Model.Cell auxCell = new SDON.Model.Cell(); cell.Row = table.Rows + 1; cell.Column = 1; //cell.Label = generateEntryString(member.EntryID); cell.Label = _entries[member.EntryID - 1].TagName; cell.TextSize = 10; cell.TextAlignH = SDON.Model.HorizontalAlignments.Left; cell.FillColor = "#FFFFFF"; cell.Truncate = 42; auxCell.Row = table.Rows + 1; auxCell.Column = 2; auxCell.TextSize = 10; auxCell.TextAlignH = SDON.Model.HorizontalAlignments.Left; auxCell.FillColor = "#FFFFFF"; auxCell.NoteIcon = "Info"; if (!SignatureInNote) { cell.Label += generateSignature(member.EntryID); } else { auxCell.Note = generateSignature(member.EntryID); } if (LinkGenerator != null) { auxCell.Hyperlink = new SDON.Model.Hyperlink(); auxCell.Hyperlink.url = LinkGenerator(member.FileName, int.Parse(member.Line), Userdata); } table.Cell.Add(cell); table.Cell.Add(auxCell); table.Rows++; }
private EntryShape generateEntryShape(int index) { if (_entries[index - 1].Kind == "namespace") { for (int i = 0; i < _namespaces.Length; i++) { if (index == _namespaces[i].EntryID) { EntryShape shape = new EntryShape(); SDON.Model.Cell cell = new SDON.Model.Cell(); SDON.Model.Cell auxCell = new SDON.Model.Cell(); shape.Shape = generateShapeTemplate(); shape.Entry = _entries[index - 1]; shape.Shape.ID = _entries[index - 1].EntryID; shape.ContainerIndex = i; cell.Label = shape.Entry.TagName + "\nnamespace"; cell.Row = 1; cell.Column = 1; cell.TextSize = 12; cell.TextAlignH = SDON.Model.HorizontalAlignments.Left; cell.FillColor = "#B0CCE3"; auxCell.Row = 1; auxCell.Column = 2; auxCell.TextSize = 12; auxCell.TextAlignH = SDON.Model.HorizontalAlignments.Left; auxCell.FillColor = "#B0CCE3"; if (LinkGenerator != null) { auxCell.Hyperlink = new SDON.Model.Hyperlink(); auxCell.Hyperlink.url = LinkGenerator(_entries[index - 1].FileName, int.Parse(_entries[index - 1].Line), Userdata); } shape.Shape.Table.Cell.Add(cell); shape.Shape.Table.Cell.Add(auxCell); return(shape); } } } else if (_entries[index - 1].Kind == "class") { for (int i = 0; i < _classes.Length; i++) { if (index == _classes[i].EntryID) { EntryShape shape = new EntryShape(); SDON.Model.Cell cell = new SDON.Model.Cell(); SDON.Model.Cell auxCell = new SDON.Model.Cell(); shape.Shape = generateShapeTemplate(); shape.Entry = _entries[index - 1]; shape.Shape.ID = _entries[index - 1].EntryID; shape.ContainerIndex = i; cell.Label = shape.Entry.TagName + "\nclass"; cell.Row = 1; cell.Column = 1; cell.TextSize = 12; cell.TextAlignH = SDON.Model.HorizontalAlignments.Left; cell.FillColor = "#B0CCE3"; auxCell.Row = 1; auxCell.Column = 2; auxCell.TextSize = 12; auxCell.TextAlignH = SDON.Model.HorizontalAlignments.Left; auxCell.FillColor = "#B0CCE3"; if (LinkGenerator != null) { auxCell.Hyperlink = new SDON.Model.Hyperlink(); auxCell.Hyperlink.url = LinkGenerator(_entries[index - 1].FileName, int.Parse(_entries[index - 1].Line), Userdata); } shape.Shape.Table.Cell.Add(cell); shape.Shape.Table.Cell.Add(auxCell); return(shape); } } } return(null); }
public SDON.Model.Shape ExportAsShape() { const bool textBold = true; const int truncate = 20; const bool hasKeys = true; SDON.Model.Shape shape = new SDON.Model.Shape(); shape.TextGrow = SDON.Model.TextGrow.Horizontal; shape.LineColor = "#BFBFBF"; if (ID != null) { shape.ID = (int)ID; } if (!_showColumns) { shape.FillColor = "#D8D8D8"; shape.Label = _tableName; shape.TextMargin = 6; shape.TextSize = 12; shape.NoteIcon = SDON.Model.Icons.Info; //SDON.Model.ColumnProperties cp = new SDON.Model.ColumnProperties(); //cell = new SDON.Model.Cell(); // //cell.Column = 2; //cell.Row = 1; //cell.Note = ""; //cell.NoteIcon = SDON.Model.Icons.Info; //cell.FillColor = "#D8D8D8"; // //cp.Index = 2; //cp.Width = 20; //cp.FixedWidth = true; for (int i = 0; i < _entries.Count; i++) { shape.Note += _entries[i].ColumnName + "\n"; } //shape.Table.Columns = 2; //shape.Table.Rows = 1; //shape.Table.Cell.Add(cell); //shape.Table.ColumnProperties = new List<SDON.Model.ColumnProperties>(); //shape.Table.ColumnProperties.Add(cp); return(shape); } shape.Table = new SDON.Model.Table(); shape.Table.Cell = new List <SDON.Model.Cell>(); shape.TextMargin = 6; SDON.Model.Cell cell; shape.Table.Columns = 1; shape.Table.Rows = _entries.Count + 1; cell = new SDON.Model.Cell(); cell.Label = _tableName; cell.Column = 1; cell.Row = 1; cell.TextBold = textBold; //cell.Truncate = truncate; cell.FillColor = "#D8D8D8"; cell.TextSize = 12; shape.Table.Cell.Add(cell); SDON.Model.RowProperties rprop; // = new SDON.Model.RowProperties(); shape.Table.RowProperties = new List <SDON.Model.RowProperties>(); //rprop.Index = 1; //rprop.LineThick = 2; //shape.Table.RowProperties.Add(rprop); SDON.Model.Join join = null; if (_showTypes) { shape.Table.Columns = 3; join = new SDON.Model.Join(); join.Row = 1; join.Column = 1; join.N = 2; shape.Table.Join = new List <SDON.Model.Join>(); shape.Table.Join.Add(join); } if (hasKeys) { shape.Table.Columns++; SDON.Model.ColumnProperties keyColumnProperties = new SDON.Model.ColumnProperties(); keyColumnProperties.Width = 20; keyColumnProperties.FixedWidth = true; keyColumnProperties.Index = 1; if (shape.Table.ColumnProperties == null) { shape.Table.ColumnProperties = new List <SDON.Model.ColumnProperties>(); } shape.Table.ColumnProperties.Add(keyColumnProperties); if (join == null) { join = new SDON.Model.Join(); join.Row = 1; join.Column = 1; shape.Table.Join = new List <SDON.Model.Join>(); shape.Table.Join.Add(join); join.N = 0; } join.N++; } for (int i = 0; i < _entries.Count; i++) { if (_showTypes) { createRowWithEntry(shape.Table, i + 2, _entries[i], true, hasKeys, true, true); } else { createRowWithEntry(shape.Table, i + 2, _entries[i], true, hasKeys, false, false); } //cell = new SDON.Model.Cell(); //cell.Label = _entries[i].ColumnName; //cell.Row = i + 2; //cell.Column = 1; //cell.TextAlignH = SDON.Model.HorizontalAlignments.Left; //cell.Truncate = 20; //cell.FillColor = "#FFFFFF"; //shape.Table.Cell.Add(cell); // //if(_showTypes) //{ // //Types // cell = new SDON.Model.Cell(); // cell.Label = _entries[i].DataType; // cell.Row = i + 2; // cell.Column = 2; // cell.TextAlignH = SDON.Model.HorizontalAlignments.Left; // cell.Truncate = 20; // cell.FillColor = "#FFFFFF"; // shape.Table.Cell.Add(cell); // // //Size // cell = new SDON.Model.Cell(); // cell.Label = (_entries[i].ColumnSize != "NULL") ? _entries[i].ColumnSize : ""; // cell.Row = i + 2; // cell.Column = 3; // cell.TextAlignH = SDON.Model.HorizontalAlignments.Left; // cell.Truncate = 20; // cell.FillColor = "#FFFFFF"; // shape.Table.Cell.Add(cell); //} rprop = new SDON.Model.RowProperties(); rprop.LineColor = "#D8D8D8"; rprop.Index = i + 1; } return(shape); }