예제 #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"),
            });
예제 #2
0
        public static WriteableBitmap[,] getPreviews(int targetDimension, XElement structure)
        {
            WriteableBitmap[,] array = new WriteableBitmap[3, 3];
            StructureParameters sp = new StructureParameters();

            sp.structureDefinitionXML = structure;
            for (int col = 0; col < 3; col++)
            {
                for (int row = 0; row < 3; row++)
                {
                    array[col, row] = sp.DrawPreview(col, row, targetDimension);
                }
            }
            return(array);
        }