Esempio n. 1
0
        private void mnuSaveAs_Click(object sender, EventArgs e)
        {
            if (elements.Count > 0)
            {
                SaveFileDialog sfd = new SaveFileDialog();
                sfd.Filter = "FlowSharp (*.fsd)|*.fsd|PNG (*.png)|*.png";
                DialogResult res = sfd.ShowDialog();

                if (res == DialogResult.OK)
                {
                    if (Path.GetExtension(sfd.FileName).ToLower() == ".png")
                    {
                        canvasController.SaveAsPng(sfd.FileName);
                    }
                    else
                    {
                        filename = sfd.FileName;
                        string data = Persist.Serialize(elements);
                        File.WriteAllText(filename, data);
                        UpdateCaption();
                    }
                }
            }
            else
            {
                MessageBox.Show("Nothing to save.", "Empty Canvas", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        protected void SaveDiagrams(string filename)
        {
            int n = 0;

            foreach (BaseController controller in Controllers)
            {
                string data = Persist.Serialize(controller.Elements);

                // If the "canvas" doesn't have a filename, we need to assign one.  For the first controller, this would be the base name,
                // subsequent unnamed canvases get auto-named "-1", "-2", etc.
                if (String.IsNullOrEmpty(controller.Filename))
                {
                    if (n == 0)
                    {
                        controller.Filename = filename;
                    }
                    else
                    {
                        controller.Filename = Path.Combine(Path.GetDirectoryName(filename), Path.GetFileNameWithoutExtension(filename) + "-" + n.ToString() + Path.GetExtension(filename));
                    }

                    ++n;
                }

                File.WriteAllText(controller.Filename, data);
            }
        }
Esempio n. 3
0
        public void Copy()
        {
            BaseController canvasController = ServiceManager.Get <IFlowSharpCanvasService>().ActiveController;

            if (editBox != null)
            {
                Clipboard.SetText(editBox.SelectedText);
                return;
            }

            if (canvasController.SelectedElements.Any())
            {
                List <GraphicElement> elementsToCopy = new List <GraphicElement>();
                // Include child elements of any groupbox, otherwise, on deserialization,
                // the ID's for the child elements aren't found.
                elementsToCopy.AddRange(canvasController.SelectedElements);
                elementsToCopy.AddRange(IncludeChildren(elementsToCopy));
                string copyBuffer = Persist.Serialize(elementsToCopy.OrderByDescending(el => canvasController.Elements.IndexOf(el)));
                Clipboard.SetData("FlowSharp", copyBuffer);
            }
            else
            {
                MessageBox.Show("Please select one or more shape(s).", "Nothing to copy.", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        protected bool SaveAs()
        {
            SaveFileDialog sfd = new SaveFileDialog();

            sfd.Filter = "FlowSharp (*.fsd)|*.fsd|PNG (*.png)|*.png";
            DialogResult res = sfd.ShowDialog();
            string       ext = ".fsd";

            if (res == DialogResult.OK)
            {
                ext = Path.GetExtension(sfd.FileName).ToLower();

                if (ext == ".png")
                {
                    canvasController.SaveAsPng(sfd.FileName);
                }
                else
                {
                    filename = sfd.FileName;
                    string data = Persist.Serialize(canvasController.Elements);
                    File.WriteAllText(filename, data);
                    UpdateCaption();
                }
            }

            return(res == DialogResult.OK && ext != ".png");
        }
Esempio n. 5
0
 protected void Copy()
 {
     if (canvasController.SelectedElement != null)
     {
         string copyBuffer = Persist.Serialize(canvasController.SelectedElement);
         Clipboard.SetData("FlowSharp", copyBuffer);
     }
 }
Esempio n. 6
0
 protected void Copy()
 {
     if (canvasController.SelectedElements.Any())
     {
         string copyBuffer = Persist.Serialize(canvasController.SelectedElements);
         Clipboard.SetData("FlowSharp", copyBuffer);
     }
     else
     {
         MessageBox.Show("Please select one or more shape(s).", "Nothing to copy.", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        protected bool SaveOrSaveAs(bool forceSaveAs = false)
        {
            bool ret = true;

            if (String.IsNullOrEmpty(filename) || forceSaveAs)
            {
                ret = SaveAs();
            }
            else
            {
                string data = Persist.Serialize(canvasController.Elements);
                File.WriteAllText(filename, data);
            }

            return(ret);
        }
Esempio n. 8
0
 protected void Copy()
 {
     if (canvasController.SelectedElements.Any())
     {
         List <GraphicElement> elementsToCopy = new List <GraphicElement>();
         // Include child elements of any groupbox, otherwise, on deserialization,
         // the ID's for the child elements aren't found.
         elementsToCopy.AddRange(canvasController.SelectedElements);
         elementsToCopy.AddRange(IncludeChildren(elementsToCopy));
         string copyBuffer = Persist.Serialize(elementsToCopy.OrderByDescending(el => elements.IndexOf(el)));
         Clipboard.SetData("FlowSharp", copyBuffer);
     }
     else
     {
         MessageBox.Show("Please select one or more shape(s).", "Nothing to copy.", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Esempio n. 9
0
        private void mnuSave_Click(object sender, EventArgs e)
        {
            if (elements.Count > 0)
            {
                if (String.IsNullOrEmpty(filename))
                {
                    mnuSaveAs_Click(sender, e);
                }

                string data = Persist.Serialize(elements);
                File.WriteAllText(filename, data);
                UpdateCaption();
            }
            else
            {
                MessageBox.Show("Nothing to save.", "Empty Canvas", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Esempio n. 10
0
        /// <summary>
        /// Uloží aktuální stav objektu do svého souboru
        /// </summary>
        private void _SaveNow()
        {
            string configFile = this._ConfigFile;

            if (String.IsNullOrEmpty(configFile))
            {
                return;
            }
            lock (this._SaveLock)
            {
                this._SaveRequesting = false;
                // Od teď už odložené čekání na uložení nemusí volat fyzické ukládání.
            }

            string data = Persist.Serialize(this);

            Application.App.TryRunBgr(() => System.IO.File.WriteAllText(configFile, data, Encoding.UTF8));
        }
Esempio n. 11
0
 private void _ConfigSave()
 {
     this._PreparePath(this._File);
     File.WriteAllText(this._File, Persist.Serialize(this));
 }
Esempio n. 12
0
        public void TestGuiData()
        {
            GuiData data = new GuiData()
            {
                Name = "Data"
            };

            data.ToolbarItems.Add(new GuiToolbarItem()
            {
                Name = "tlbSave", Title = "Uložit", ToolTip = "Uložit všechna data"
            });
            data.ToolbarItems.Add(new GuiToolbarItem()
            {
                Name = "tlbReload", Title = "Přenačíst", ToolTip = "Znovu načíst všechna data"
            });

            data.ContextMenuItems.Add(new GuiContextMenuItem()
            {
                Name = "cnxAddWork", Title = "Přidá další práci", ToolTip = "Přidá další práci v označeném místě"
            });

            GuiPage page = new GuiPage()
            {
                Name = "pageMain", Title = "Dílna 1", ToolTip = "Zobrazuje veškerá data první dílny"
            };

            data.Pages.Add(page);

            GuiGrid taskGrid = new GuiGrid()
            {
                Name = "taskGrid", Title = "Pracovní úkoly", ToolTip = "Zobrazuje úkoly, které se mají na této dílně provádět"
            };
            GuiDataTable taskRows = new GuiDataTable()
            {
                Name = "taskRows"
            };

            taskRows.ClassId = 1363;
            taskRows.AddColumn(new GuiDataColumn()
            {
                Name = "record_gid", BrowseColumnType = BrowseColumnType.RecordId
            });
            taskRows.AddColumn(new GuiDataColumn()
            {
                Name = "reference", Title = "Reference", Width = 85
            });
            taskRows.AddColumn(new GuiDataColumn()
            {
                Name = "nazev", Title = "Název", Width = 200
            });
            taskRows.AddColumn(new GuiDataColumn()
            {
                Name = "constr_element", Title = "Dílec", Width = 200
            });
            taskGrid.RowTable = taskRows;
            page.LeftPanel.Grids.Add(taskGrid);

            GuiGrid workGrid = new GuiGrid()
            {
                Name = "workGrid", Title = "Pracovní rozvrh", ToolTip = "Zobrazuje prostor dílny a její využití"
            };
            GuiDataTable workRows = new GuiDataTable()
            {
                Name = "workRows"
            };

            workRows.ClassId = 1817;
            workRows.AddColumn(new GuiDataColumn()
            {
                Name = "record_gid", BrowseColumnType = BrowseColumnType.RecordId
            });
            workRows.AddColumn(new GuiDataColumn()
            {
                Name = "reference", Title = "Reference", Width = 85
            });
            workRows.AddColumn(new GuiDataColumn()
            {
                Name = "nazev", Title = "Název", Width = 200
            });
            workRows.AddColumn(new GuiDataColumn()
            {
                Name = "constr_element", Title = "Dílec", Width = 200
            });
            GuiDataRow wr1 = workRows.AddRow(new GuiId(1817, 1), "Refer 1", "Název 1", "Výrobek A");

            wr1.Graph = new GuiGraph();
            wr1.Graph.GraphItems.Add(new GuiGraphItem()
            {
                ItemId = new GuiId(1817, 1), RowId = new GuiId(1364, 1), Time = new GuiTimeRange(new DateTime(2018, 8, 1, 12, 0, 0), new DateTime(2018, 8, 1, 16, 0, 0))
            });
            wr1.Graph.GraphItems.Add(new GuiGraphItem()
            {
                ItemId = new GuiId(1817, 2), RowId = new GuiId(1364, 1), Time = new GuiTimeRange(new DateTime(2018, 8, 1, 16, 0, 0), new DateTime(2018, 8, 1, 20, 0, 0))
            });
            wr1.Graph.GraphItems.Add(new GuiGraphItem()
            {
                ItemId = new GuiId(1817, 3), RowId = new GuiId(1364, 1), Time = new GuiTimeRange(new DateTime(2018, 8, 1, 21, 0, 0), new DateTime(2018, 8, 1, 22, 0, 0))
            });
            GuiDataRow wr2 = workRows.AddRow(new GuiId(1817, 2), "Referen 2", "Náz 2", "Výrobek B");
            GuiDataRow wr3 = workRows.AddRow(new GuiId(1817, 3), "Reference 3", "N 3", "Výrobek C");

            workGrid.RowTable = workRows;

            workGrid.GraphProperties.AxisResizeMode        = AxisResizeContentMode.ChangeScale;
            workGrid.GraphProperties.InteractiveChangeMode = AxisInteractiveChangeMode.Shift;

            GraphItemBehaviorMode graph4BehaviorMode = (GraphItemBehaviorMode.DefaultText | GraphItemBehaviorMode.ResizeTime);
            DateTime graph4Begin = new DateTime(2018, 8, 1, 14, 30, 45, 550);
            DateTime graph4End   = new DateTime(2018, 8, 1, 18, 15, 30, 10);

            wr1.Graph.GraphItems.Add(new GuiGraphItem()
            {
                ItemId = new GuiId(1817, 4), RowId = new GuiId(1364, 2), Time = new GuiTimeRange(graph4Begin, graph4End), BehaviorMode = graph4BehaviorMode
            });

            page.MainPanel.Grids.Add(workGrid);

            data.Finalise();

            string guiMainItems = workRows.FullName;
            string guiItem4Path = wr1.Graph.GraphItems[0].FullName;

            IGuiItem item1 = data.FindByFullName(@"Data\toolBar\tlbSave");
            IGuiItem item2 = data.FindByFullName(@"Data\contextMenu\cnxAddWork");
            IGuiItem item3 = data.FindByFullName(@"Data\pageMain\mainPanel\workGrid\");


            string serial   = Persist.Serialize(data);
            object deserial = Persist.Deserialize(serial);

            if (deserial == null)
            {
                throw new AssertFailedException("Deserializovaný objekt je null.");
            }

            GuiData clone = deserial as GuiData;

            if (clone == null)
            {
                throw new AssertFailedException("Deserializovaný objekt není odpovídající třídy GuiData.");
            }

            if (clone.ToolbarItems.Count != data.ToolbarItems.Count)
            {
                throw new AssertFailedException("Deserializovaný objekt neobsahuje odpovídající počet prvků v ToolbarItems, má být " + data.ToolbarItems.Count + "; je " + clone.ToolbarItems.Count + ".");
            }

            if (clone.ToolbarItems.Items[0].Name != data.ToolbarItems.Items[0].Name)
            {
                throw new AssertFailedException("Deserializovaný objekt neobsahuje odpovídající Name prvku ToolbarItems[0], má být " + data.ToolbarItems.Items[0].Name + "; je " + clone.ToolbarItems.Items[0].Name + ".");
            }

            if (clone.Pages.Count != data.Pages.Count)
            {
                throw new AssertFailedException("Deserializovaný objekt neobsahuje odpovídající počet prvků v Pages, má být " + data.Pages.Count + "; je " + clone.Pages.Count + ".");
            }

            if (clone.Pages[0].Name != data.Pages[0].Name)
            {
                throw new AssertFailedException("Deserializovaný objekt neobsahuje odpovídající Title prvku Pages[0], má být " + data.Pages[0].Title + "; je " + clone.Pages[0].Title + ".");
            }

            if (clone.Pages[0].LeftPanel.Grids.Count != data.Pages[0].LeftPanel.Grids.Count)
            {
                throw new AssertFailedException("Deserializovaný objekt neobsahuje odpovídající počet prvků v Pages[0].LeftPanel.Grids, má být " + data.Pages[0].LeftPanel.Grids.Count + "; je " + clone.Pages[0].LeftPanel.Grids.Count + ".");
            }

            string taskGridText = taskGrid.ToString();
            string taskClonText = clone.Pages[0].LeftPanel.Grids[0].ToString();

            if (taskClonText != taskGridText)
            {
                throw new AssertFailedException("Deserializovaný objekt neobsahuje odpovídající obsah v TaskGridu, má být " + taskGridText + "; je " + taskClonText + ".");
            }

            if (clone.Pages[0].MainPanel.Grids.Count != data.Pages[0].MainPanel.Grids.Count)
            {
                throw new AssertFailedException("Deserializovaný objekt neobsahuje odpovídající počet prvků v Pages[0].MainPanel.Grids, má být " + data.Pages[0].MainPanel.Grids.Count + "; je " + clone.Pages[0].MainPanel.Grids.Count + ".");
            }

            string workGridText = workGrid.ToString();
            string workClonText = clone.Pages[0].MainPanel.Grids[0].ToString();

            if (workClonText != workGridText)
            {
                throw new AssertFailedException("Deserializovaný objekt neobsahuje odpovídající obsah v WorkGridu, má být " + workGridText + "; je " + workClonText + ".");
            }

            GuiGraphTable workItemsB = data.FindByFullName(guiMainItems) as GuiGraphTable;

            GuiGraphItem graphItem4B = data.FindByFullName(guiItem4Path) as GuiGraphItem;

            if (graphItem4B == null)
            {
                throw new AssertFailedException("Deserializovaný objekt neobsahuje grafický prvek 4.");
            }

            if (graphItem4B.BehaviorMode != graph4BehaviorMode)
            {
                throw new AssertFailedException("Deserializovaný grafický prvek 4 nemá správnou hodnotu BehaviorMode, má být " + graph4BehaviorMode + "; je " + graphItem4B.BehaviorMode + ".");
            }
            if (graphItem4B.Time.Begin != graph4Begin)
            {
                throw new AssertFailedException("Deserializovaný grafický prvek 4 nemá správnou hodnotu Begin, má být " + graph4Begin + "; je " + graphItem4B.Time.Begin + ".");
            }
            if (graphItem4B.Time.End != graph4End)
            {
                throw new AssertFailedException("Deserializovaný grafický prvek 4 nemá správnou hodnotu End, má být " + graph4End + "; je " + graphItem4B.Time.End + ".");
            }
        }
        protected void SaveSelection(string filename)
        {
            string data = Persist.Serialize(ActiveController.SelectedElements);

            File.WriteAllText(filename, data);
        }
Esempio n. 14
0
        public void TestXmlPersistSimple()
        {
            object[] source = new object[3];
            source[0] = 0;
            source[1] = "XXX";
            object[]        values = new object[3];
            TestSimpleClass value0 = new TestSimpleClass()
            {
                Name = "Name0", Value = 0
            };
            TestSimpleClass value1 = new TestSimpleClass()
            {
                Name = "Name1", Value = "Item1"
            };
            TestSimpleClass value2 = new TestSimpleClass()
            {
                Name = "Name2"
            };
            TestSimpleClass value2a = new TestSimpleClass()
            {
                Name = "Name2a", Value = "Item2a"
            };

            value2.Value = value2a;
            values[0]    = value0;
            values[1]    = value1;
            values[2]    = value2;

            source[2] = values;

            string xml = Persist.Serialize(source, PersistArgs.Default);

            object result = Persist.Deserialize(xml);

            if (result == null)
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized = null");
            }

            object[] target = result as object[];
            if (target == null)
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized is not array object[]");
            }
            if (target.Length != source.Length)
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized array has wrong length");
            }

            if (!(target[0] is int))
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized array has wrong type of item[0]");
            }
            if (((int)(target[0])) != ((int)(source[0])))
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized array has wrong value of item[0]");
            }

            if (!(target[1] is string))
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized array has wrong type of item[1]");
            }
            if (((string)(target[1])) != ((string)(source[1])))
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized array has wrong value of item[1]");
            }

            if (target[2] == null)
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized array has wrong item[2] == null");
            }
            object[] clones = target[2] as object[];
            if (clones == null)
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized array has wrong type item[2], has be object[]");
            }
            if (clones.Length != values.Length)
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized array in item[2] has wrong length");
            }

            TestSimpleClass clone0 = clones[0] as TestSimpleClass;

            if (clone0 == null)
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized array in item[2] has wrong item[0]");
            }
            if (clone0.Name != value0.Name)
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized clone 0 has wrong Name");
            }
            if (clone0.Value.ToString() != value0.Value.ToString())
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized clone 0 has wrong Value");
            }

            TestSimpleClass clone1 = clones[1] as TestSimpleClass;

            if (clone1 == null)
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized array in item[2] has wrong item[1]");
            }
            if (clone1.Name != value1.Name)
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized clone 1 has wrong Name");
            }
            if (clone1.Value.ToString() != value1.Value.ToString())
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized clone 1 has wrong Value");
            }

            TestSimpleClass clone2 = clones[2] as TestSimpleClass;

            if (clone2 == null)
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized array in item[2] has wrong item[2]");
            }
            if (clone2.Name != value2.Name)
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized clone 2 has wrong Name");
            }

            TestSimpleClass clone2a = clone2.Value as TestSimpleClass;

            if (clone2a == null)
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized array in item[2] has wrong item[2].Value");
            }
            if (clone2a.Name != value2a.Name)
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized clone 2a has wrong Name");
            }
            if (clone2a.Value.ToString() != value2a.Value.ToString())
            {
                throw new AssertFailedException("TestXmlPersistSimple: deserialized clone 2a has wrong Value");
            }
        }
Esempio n. 15
0
        public void TestXmlPersistClass()
        {
            TestPersist orig  = new TestPersist();
            GuiId       guiId = new GuiId(1180, 123456);

            orig.GuiId = guiId;

            orig.Array    = new object[6];
            orig.Array[0] = "Zkouška\r\nřádku";
            orig.Array[1] = new DateTime(2019, 01, 15, 12, 0, 0);
            orig.Array[2] = 16.02m;
            orig.Array[3] = new Rectangle(5, 10, 100, 50);
            orig.Array[4] = new List <int> {
                10, 20, 30
            };


            GuiId guiId0 = new GuiId(21, 1234);
            GuiId guiId5 = new GuiId(26, 6789);

            orig.GuiIdList = new List <GuiId>();
            orig.GuiIdList.Add(guiId0);
            orig.GuiIdList.Add(new GuiId(22, 2345));
            orig.GuiIdList.Add(null);                    // new GuiId(23, 3456));
            orig.GuiIdList.Add(new GuiId(24, 4567));
            orig.GuiIdList.Add(new GuiId(25, 5678));
            orig.GuiIdList.Add(guiId5);

            orig.Tabulka = new string[3, 2];
            for (int r = 0; r < 3; r++)
            {
                for (int c = 0; c < 2; c++)
                {
                    orig.Tabulka[r, c] = "Pozice(" + r + "," + c + ")";
                }
            }

            orig.Sachovnice = new TestDictionary();
            GuiId key1 = new GuiId(1, 101);
            GuiId key6 = new GuiId(1, 106);

            orig.Sachovnice.Add(key1, new Rectangle(1, 1, 1, 1));
            orig.Sachovnice.Add(new GuiId(1, 102), new Rectangle(2, 2, 2, 2));
            orig.Sachovnice.Add(new GuiId(1, 103), new Rectangle(3, 3, 3, 3));
            orig.Sachovnice.Add(new GuiId(1, 104), new Rectangle(4, 4, 4, 4));
            orig.Sachovnice.Add(new GuiId(1, 105), new Rectangle(5, 5, 5, 5));
            orig.Sachovnice.Add(key6, new Rectangle(6, 6, 6, 6));

            orig.Images = new List <GuiImage>();
            orig.Images.Add(RES.Images.Actions16.DialogNo3Png);
            orig.Images.Add(RES.Images.Actions16.DialogOk3Png);
            orig.Images.Add(RES.Images.Actions16.DialogOkApply3Png);

            string zip = Persist.Serialize(orig, PersistArgs.Compressed);
            string xml = Persist.Serialize(orig, PersistArgs.Default);

            TestPersist copy = Persist.Deserialize(zip) as TestPersist;

            // Test shodného obsahu:
            if (copy.GuiId == null)
            {
                throw new AssertFailedException("TestPersist.GuiId is null");
            }
            if (copy.GuiId != guiId)
            {
                throw new AssertFailedException("TestPersist.GuiId is not equal to original");
            }

            if (copy.GuiIdList == null)
            {
                throw new AssertFailedException("TestPersist.GuiIdList is null");
            }
            if (copy.GuiIdList.Count != 6)
            {
                throw new AssertFailedException("TestPersist.GuiIdList has bad count");
            }
            if (copy.GuiIdList[0] != guiId0)
            {
                throw new AssertFailedException("TestPersist.GuiIdList[0] is not equal to original");
            }
            if (copy.GuiIdList[2] != null)
            {
                throw new AssertFailedException("TestPersist.GuiIdList[2] is not null");
            }
            if (copy.GuiIdList[5] != guiId5)
            {
                throw new AssertFailedException("TestPersist.GuiIdList[5] is not equal to original");
            }

            if (copy.Tabulka == null)
            {
                throw new AssertFailedException("TestPersist.Tabulka is null");
            }
            if (copy.Tabulka.Rank != 2)
            {
                throw new AssertFailedException("TestPersist.Tabulka has Rank != 2");
            }
            if (copy.Tabulka.GetLength(0) != 3)
            {
                throw new AssertFailedException("TestPersist.Tabulka has Length(0) != 3");
            }
            if (copy.Tabulka.GetLength(1) != 2)
            {
                throw new AssertFailedException("TestPersist.Tabulka has Length(1) != 2");
            }
            if (copy.Tabulka[2, 1] != "Pozice(2,1)")
            {
                throw new AssertFailedException("TestPersist.Tabulka has bad value in cell [2,1]");
            }

            if (copy.Sachovnice == null)
            {
                throw new AssertFailedException("TestPersist.Sachovnice is null");
            }
            if (copy.Sachovnice.Count != 6)
            {
                throw new AssertFailedException("TestPersist.Sachovnice has bad count");
            }
            if (!copy.Sachovnice.ContainsKey(key1))
            {
                throw new AssertFailedException("TestPersist.Sachovnice does not contains key0");
            }
            if (copy.Sachovnice[key1].Top != 1)
            {
                throw new AssertFailedException("TestPersist.Sachovnice in [key0] has bad value");
            }
            if (!copy.Sachovnice.ContainsKey(key6))
            {
                throw new AssertFailedException("TestPersist.Sachovnice does not contains key5");
            }
            if (copy.Sachovnice[key6].Top != 6)
            {
                throw new AssertFailedException("TestPersist.Sachovnice in [key5] has bad value");
            }
        }