protected override void GenerateTree(object obj) { NewReleaseItem newReleaseItem = (NewReleaseItem) obj; NewReleaseHierarchyNode root = new NewReleaseHierarchyNode(newReleaseItem, this); RootNodes.Add(root); NodeDictionary.Add(root.NewReleaseItem.Album.Name, root); }
/// <summary> /// Create a graph node and add it to the view-model. /// </summary> public NetworkNodeViewModel CreateNewReleasesGraphNode(IHierarchyNode hierarchyNode, Point nodeLocation) { Debug.Assert(hierarchyNode is NewReleaseHierarchyNode); NewReleaseItem newReleaseItem = ((NewReleaseHierarchyNode)hierarchyNode).NewReleaseItem; NewReleaseNetworkNodeViewModel node = new NewReleaseNetworkNodeViewModel(newReleaseItem); // Initialize any style modifiers. node.X = nodeLocation.X; node.Y = nodeLocation.Y; node.InputConnectors.Add(new ConnectorViewModel("", ConnectorType.Input)); node.OutputConnectors.Add(new ConnectorViewModel("", ConnectorType.Output)); hierarchyNode.GraphNodeViewModel = node; // Add the node to the view-model. // this.Network.Nodes.Add(node); return(node); }
public NewReleaseNetworkNodeViewModel(NewReleaseItem newReleaseItem) : base(newReleaseItem.Artist.Name) { _newReleaseItem = newReleaseItem; }
public NewReleaseHierarchyNode(NewReleaseItem newReleaseItem, AtlasHierarchy hierarchy) : base(hierarchy, null, 0) { NewReleaseItem = newReleaseItem; }
public override void AddRootNode(object obj) { NewReleaseItem newRelease = (NewReleaseItem)obj; GenerateTree(newRelease); }