Exemplo n.º 1
0
        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"),
            });
Exemplo n.º 2
0
        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");
            }
        }