public TableItem(TableItem prototype) { mText = prototype.Text; mFont = prototype.Font; mForecolor = prototype.Forecolor; mBackcolor = prototype.Backcolor; mIndent = prototype.Indent; mTag = prototype.Tag; mParent = prototype.Parent; mTable = prototype.Table; }
public Table(Table prototype): base(prototype) { mHeadingHeight = prototype.HeadingHeight; mHeading = prototype.Heading; mSubHeading = prototype.SubHeading; mGroupHeight = prototype.GroupHeight; mRowHeight = prototype.RowHeight; mRowIndent = prototype.Indent; mExpanded = prototype.Expanded; mDrawExpand = prototype.DrawExpand; mForecolor = prototype.Forecolor; GradientColor = prototype.GradientColor; mDrawSelectedItem = prototype.DrawSelectedItem; mFont = prototype.Font; ContractedSize = prototype.ContractedSize; ExpandedSize = prototype.ExpandedSize; Groups = new TableItems(typeof(TableGroup)); Rows = new TableItems(typeof(TableRow)); Table.CopyGroups(prototype.Groups,Groups); Table.CopyRows(prototype.Rows,Rows); }
public virtual Shape CreateTable(PointF start,SizeF size) { Table table = new Table(); table.Location = start; if (!size.IsEmpty) table.Size = size; OnCreateElement(table); return table; }
public virtual Shape CreateTable() { Table table = new Table(); OnCreateElement(table); return table; }
//Sets the internal table reference protected internal virtual void SetTable(Table table) { mTable = table; }
private void ResetTable(TableItem item, Table table) { if (item is TableRow) { TableRow tableRow = (TableRow)item; if (tableRow is EsriTableRow) { ((EsriTableRow)tableRow).SetTable2(table); } } else if (item is TableGroup) { TableGroup tableGroup = (TableGroup)item; if (tableGroup is EsriTableGroup) { ((EsriTableGroup)tableGroup).SetTable2(table); } foreach (TableItem item2 in tableGroup.Groups) { this.ResetTable(item2, table); } foreach (TableItem item3 in tableGroup.Rows) { this.ResetTable(item3, table); } } }
private async void FillMap(Room room) { await Task.Run(() => { AI.PathFinding.TreeNode startNode = new AI.PathFinding.TreeNode(room); startNode.Parent = startNode; AI.PathFinding.TreeTraverser traverser = new AI.PathFinding.TreeTraverser(startNode, ""); Stack<AI.PathFinding.TreeNode> traversedTree = traverser.GetTraversedNodes(); Crainiate.Diagramming.Model model = new Model(); PointF position = new PointF(200, 400); Table roomNode = new Table(); roomNode.BackColor = Color.Green; foreach (AI.PathFinding.TreeNode treeNode in traversedTree.Reverse()) { if (model.Shapes.ContainsKey(treeNode.ID.ToString())) { position = model.Shapes[treeNode.ID.ToString()].Location; } roomNode.Location = position; roomNode.Heading = treeNode.ID.ToString(); roomNode.SubHeading = treeNode.Title; if (!model.Shapes.ContainsKey(treeNode.ID.ToString())) { model.Shapes.Add(treeNode.ID.ToString(), roomNode); } Arrow arrow = new Arrow(); arrow.DrawBackground = false; arrow.Inset = 0; foreach (var adjNode in treeNode.AdjacentNodes) { RoomExits direction = (RoomExits)Enum.Parse(typeof(RoomExits), adjNode.Key); Table adjShape = new Table(); adjShape.Heading = adjNode.Value.ID.ToString(); adjShape.SubHeading = adjNode.Value.Title; adjShape.BackColor = Color.LightBlue; switch (direction) { case RoomExits.North: adjShape.Location = new PointF(position.X, position.Y - 100); break; case RoomExits.South: adjShape.Location = new PointF(position.X, position.Y + 100); break; case RoomExits.East: adjShape.Location = new PointF(position.X + 150, position.Y); break; case RoomExits.West: adjShape.Location = new PointF(position.X - 150, position.Y); break; case RoomExits.Up: adjShape.Location = new PointF(position.X - 150, position.Y - 100); break; case RoomExits.Down: adjShape.Location = new PointF(position.X + 150, position.Y + 100); break; } if (!model.Shapes.ContainsKey(adjNode.Value.ID.ToString())) { model.Shapes.Add(adjNode.Value.ID.ToString(), adjShape); } Connector line = new Connector(model.Shapes[treeNode.ID.ToString()], model.Shapes[adjNode.Value.ID.ToString()]); line.End.Marker = arrow; model.Lines.Add(model.Lines.CreateKey(), line); adjShape = new Table(); } roomNode = new Table(); } mapDiagram.SetModel(model); mapDiagram.Invoke((MethodInvoker)delegate { mapDiagram.Refresh(); }); }); }
public void SetTable2(Table table) { this.SetTable(table); }