public IDominoWrapper(DominoAssembly parent) { Innode = new DominoConnector { next = this }; this.parent = parent; }
public static IDominoWrapper CreateNodeFromPath(DominoAssembly futureParent, string path) { var parentPath = Workspace.Find(futureParent); var relPath = Workspace.MakeRelativePath(parentPath, path); var deserialized = Workspace.Load <IDominoProvider>(path); return(deserialized switch { FieldParameters _ => new FieldNode(relPath, futureParent), StructureParameters _ => new StructureNode(relPath, futureParent), SpiralParameters _ => new SpiralNode(relPath, futureParent), CircleParameters _ => new CircleNode(relPath, futureParent), _ => throw new ArgumentException("Path is not loadable"), });
// Check for circular references public bool ContainsReferenceTo(DominoAssembly assembly) { bool result = false; foreach (var s in children.OfType <AssemblyNode>()) { if (s.obj == assembly) { return(true); } else { result = result && ContainsReferenceTo(assembly); } } return(result); }
public static IDominoWrapper CreateNodeFromPath(DominoAssembly futureParent, string path) { var parentPath = Workspace.Find(futureParent); var relPath = Workspace.MakeRelativePath(parentPath, path); var deserialized = Workspace.Load <IDominoProvider>(path); switch (deserialized) { case FieldParameters p: return(new FieldNode(relPath, futureParent)); case StructureParameters p: return(new StructureNode(relPath, futureParent)); case SpiralParameters p: return(new SpiralNode(relPath, futureParent)); case CircleParameters p: return(new CircleNode(relPath, futureParent)); default: throw new ArgumentException("Path is not loadable"); } }
public IDominoWrapper(DominoAssembly parent) { innode = new DominoConnector(); innode.next = this; this.parent = parent; }