public AddChild ( |
||
item | ||
Результат | void |
private GridItemViewModel CreateGridViewModel(Interop.Grid grid) { GridItemViewModel root = new GridItemViewModel( new GridItem() { Name = grid.Name, Type = GridItemType.Root }, grid.Definitions, grid.Path ); foreach (KeyValuePair <string, List <Interop.TerminalBlock> > pair in grid.Blocks) { GridItemViewModel node = new GridItemViewModel( new GridItem() { Name = pair.Key, Type = GridItemType.Group }, root ); foreach (Interop.TerminalBlock block in pair.Value) { if (block.IsProgram) { node.AddChild( new GridItemViewModel( new GridItem() { Name = block.Name, EntityID = block.EntityID, Type = GridItemType.Program, Program = block.Program }, node ) ); } else { node.AddChild( new GridItemViewModel( new GridItem() { Name = block.Name, EntityID = block.EntityID, Type = GridItemType.Block }, node ) ); } } root.AddChild(node); } return(root); }
private GridItemViewModel CreateGridViewModel(Interop.Grid grid) { GridItemViewModel root = new GridItemViewModel( new GridItem() { Name = grid.Name, Type = GridItemType.Root }, grid.Definitions, grid.Path ); foreach(KeyValuePair<string, List<Interop.TerminalBlock>> pair in grid.Blocks) { GridItemViewModel node = new GridItemViewModel( new GridItem() { Name = pair.Key, Type = GridItemType.Group }, root ); foreach(Interop.TerminalBlock block in pair.Value) { if (block.IsProgram) { node.AddChild( new GridItemViewModel( new GridItem() { Name = block.Name, EntityID = block.EntityID, Type = GridItemType.Program, Program = block.Program }, node ) ); } else { node.AddChild( new GridItemViewModel( new GridItem() { Name = block.Name, EntityID = block.EntityID, Type = GridItemType.Block }, node ) ); } } root.AddChild(node); } return root; }