public void MoveNoteOutOfParent_SaveShouldHappenAutomatically() { _w.output("START"); System.Windows.Forms.Form form = new System.Windows.Forms.Form(); _TestSingleTon.Instance._SetupForLayoutPanelTests(); FAKE_LayoutPanel panel = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); LayoutDetails.Instance.CurrentLayout = panel; form.Controls.Add(panel); form.Show(); //NOTE: For now remember that htis ADDS 1 Extra notes panel.NewLayout("mynewpanel", true, null); panel.SetCaption("TheMainPanel"); NoteDataXML basicNote = new NoteDataXML(); basicNote.Caption = "note1"; panel.AddNote(basicNote); //basicNote.CreateParent(panel); //panel.MoveNote( // create four panels A and B at root level. C inside A. D inside C FAKE_NoteDataXML_Panel panelA = new FAKE_NoteDataXML_Panel(); panelA.Caption = "PanelA"; panelA.GuidForNote = "panela"; FAKE_NoteDataXML_Panel panelB = new FAKE_NoteDataXML_Panel(); panelB.Caption = "PanelB"; panelB.GuidForNote = "panelb"; FAKE_NoteDataXML_Panel panelC = new FAKE_NoteDataXML_Panel(); panelC.Caption = "PanelC"; panelC.GuidForNote = "panelc"; _w.output("panels made"); panel.AddNote(panelA); // 1 panel.AddNote(panelB); // 2 //panelA.CreateParent(panel); should not need to call this when doing LayoutPanel.AddNote because it calls CreateParent insid eof it basicNote = new NoteDataXML(); basicNote.Caption = "note2"; panelA.AddNote(basicNote); // Panel A has 1 note basicNote.CreateParent(panelA.myLayoutPanel()); // DO need to call it when adding notes like this (to a subpanel, I think) basicNote.BringToFrontAndShow(); NoteDataXML_RichText textNote = new NoteDataXML_RichText(); textNote.Caption = "howdy"; // ((FAKE_LayoutPanel)panelA.GetPanelsLayout()).SetCaption("boohowcrashmenow"); panelA.AddNote(textNote); textNote.CreateParent(panelA.myLayoutPanel()); textNote.BringToFrontAndShow(); textNote.TestEnter(); panelA.GetPanelsLayout().TestForceError(); // the current layout can never be set to a subplayout Assert.AreNotEqual(panelA.GetPanelsLayout(), LayoutDetails.Instance.CurrentLayout, "the current layout can never be set to a subplayout"); panel.SaveLayout(); Assert.AreEqual(2, panelA.CountNotes(), "Panel A holds TWo note"); // So this counts as + 2 // so we have (1 + 1 note on it)panel A + (1)panelB + basicNote +DefaultNote = 5 + (NEW) LinkTable = 6 _w.output("STARTCOUNT"); Assert.AreEqual(7, panel.CountNotes(), "Total notes SHOULD BE 7 : (1 + 1 note on it)panel A + (1+1textnote)panelB + basicNote +DefaultNote = 5 + (NEW) LinkTable = 6"); _w.output("ENDCOUNT"); // now we move basicNote out // WITOUT calling save **** // it should still ahve saved panelA.myLayoutPanel().MoveNote(basicNote.GuidForNote, "up"); Assert.AreEqual(1, panelA.CountNotes(), "Panel A holds 1 note -- because we moved one out"); Assert.AreEqual(7, panel.CountNotes(), "Total notes SHOULD BE 6 : (1 + 1 note on it)panel A + (1)panelB + basicNote +DefaultNote = 5 + (NEW) LinkTable = 6"); panel = null; panel = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); panel.LoadLayout("mynewpanel", false, null); //Assert.AreEqual (0, panelA.CountNotes (), "Panel A holds one note"); Assert.AreEqual(7, panel.CountNotes(), "Total notes SHOULD BE 6 : (1 + 1 note on it)panel A + (1)panelB + basicNote +DefaultNote = 5 + (NEW) LinkTable = 6"); }
public void TestMovingNotes() { _w.output("START"); System.Windows.Forms.Form form = new System.Windows.Forms.Form(); _TestSingleTon.Instance._SetupForLayoutPanelTests(); FAKE_LayoutPanel panel = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); form.Controls.Add(panel); form.Show(); //NOTE: For now remember that htis ADDS 1 Extra notes panel.NewLayout("mynewpanel", true, null); NoteDataXML basicNote = new NoteDataXML(); basicNote.Caption = "note1"; panel.AddNote(basicNote); //basicNote.CreateParent(panel); //panel.MoveNote( // create four panels A and B at root level. C inside A. D inside C FAKE_NoteDataXML_Panel panelA = new FAKE_NoteDataXML_Panel(); panelA.Caption = "PanelA"; panelA.GuidForNote = "panela"; FAKE_NoteDataXML_Panel panelB = new FAKE_NoteDataXML_Panel(); panelB.Caption = "PanelB"; panelB.GuidForNote = "panelb"; FAKE_NoteDataXML_Panel panelC = new FAKE_NoteDataXML_Panel(); panelC.Caption = "PanelC"; panelC.GuidForNote = "panelc"; _w.output("panels made"); panel.AddNote(panelA); // 1 panel.AddNote(panelB); // 2 //panelA.CreateParent(panel); should not need to call this when doing LayoutPanel.AddNote because it calls CreateParent insid eof it basicNote = new NoteDataXML(); basicNote.Caption = "note2"; panelA.AddNote(basicNote); // Panel A has 1 note basicNote.CreateParent(panelA.myLayoutPanel()); // DO need to call it when adding notes like this (to a subpanel, I think) panel.SaveLayout(); Assert.AreEqual(1, panelA.CountNotes(), "Panel A holds one note"); // So this counts as + 2 // so we have (1 + 1 note on it)panel A + (1)panelB + basicNote +DefaultNote = 5 + (NEW) LinkTable = 6 _w.output("STARTCOUNT"); Assert.AreEqual(6, panel.CountNotes(), "Total notes SHOULD BE 6 : (1 + 1 note on it)panel A + (1)panelB + basicNote +DefaultNote = 5 + (NEW) LinkTable = 6"); _w.output("ENDCOUNT"); //COUNT SHOULD BE: panelA has 1 note //COUNT Total should be: Default Note + Note + PanelA + Panel B + (Note Inside Panel A) = 5 panelA.AddNote(panelC); // panelC is now part of Panel 2 panelC.CreateParent(panelA.myLayoutPanel()); panel.SaveLayout(); // NEED TO SAVE before conts will be accurated //COUNT SHOULD BE: panelA has 2 notes (Panel C + the Note I add) _w.output("START COUNT SUB"); Assert.AreEqual(2, panelA.CountNotes(), "two notes in panelA"); _w.output("END COUNT SUB"); Assert.AreEqual(7, panel.CountNotes(), "total of SEVEN notes"); _w.output("START COUNT SUB2"); Assert.AreEqual(0, panelB.CountNotes(), "0 count worked?"); _w.output("END COUNT SUB2"); //COUNT Total should be: Default Note + Note + PanelA + Panel B + (NoteInside Panel A) + (Panel C Inside Panel A) = 6 FAKE_NoteDataXML_Panel panelD = new FAKE_NoteDataXML_Panel(); panelD.Caption = "PanelD"; panelC.AddNote(panelD); // panelC which is inside PANELA now adds panelD (which is empty?) panelD.CreateParent(panelC.myLayoutPanel()); panel.SaveLayout(); _w.output("START COUNT SUB3"); Assert.AreEqual(0, panelD.CountNotes(), "No notes in panelD"); _w.output("START COUNT SUB3"); /* * NoteDataXML_RichText extra = new NoteDataXML_RichText(); * panelD.AddNote (extra); //this was here only to test that there is an error with counting EMPTY panels * extra.CreateParent(panelD.myLayoutPanel()); * panel.SaveLayout();*/ // update on ERROR: Every note in D is being counted DOUBLE // weird error: If a panel is empty it will register as +1 (i.e, counted twice) // PanelC and PanelA are adding this note // AddChildrenToList, TYPE: TEMPORARY, scanning children...47d43f01-a031-42d1-8539-bb7ae284a9e1 from PanelC // AddChildrenToList, TYPE: TEMPORARY, scanning children...47d43f01-a031-42d1-8539-bb7ae284a9e1 from PanelA //OK: Every note is claiming ownership of the TEXT NOTE, which is the problem, I think. _w.output("START COUNT SUB4"); Assert.AreEqual(1, panelC.CountNotes(), "1 notes in panelC"); _w.output("E COUNT SUB4"); Assert.AreEqual(0, panelD.CountNotes(), "1 note in panelD"); _w.output("_------------------------------"); _w.output("panel.CountNotes=" + panel.CountNotes()); _w.output("_------------------------------"); Assert.AreEqual(8, panel.CountNotes(), "We have only added one panel so we should be up to 8"); Assert.AreEqual(3, panelA.CountNotes()); Assert.AreEqual(8, panel.CountNotes(), "number of notes in main panel"); Assert.AreEqual(0, panelB.CountNotes(), "testt"); Assert.AreEqual(1, panelC.CountNotes(), "testt"); // add a note to panel d (we want to make sure this note does not disappear while D is being moved around NoteDataXML noteford = new NoteDataXML(); noteford.Caption = "note for d"; panelD.AddNote(noteford); // Move panel D from panelC into PANEL A panelC.myLayoutPanel().MoveNote(panelD.GuidForNote, "up"); panel.SaveLayout(); Assert.AreEqual(4, panelA.CountNotes()); // 4 because I added a note to D which is inside A Assert.AreEqual(9, panel.CountNotes()); Assert.AreEqual(0, panelC.CountNotes()); Assert.AreEqual(0, panelB.CountNotes()); Assert.AreEqual(1, panelD.CountNotes()); // Move panel D from panelA into ROOT panelA.myLayoutPanel().MoveNote(panelD.GuidForNote, "up"); panel.SaveLayout(); Assert.AreEqual(2, panelA.CountNotes()); Assert.AreEqual(9, panel.CountNotes()); Assert.AreEqual(0, panelC.CountNotes()); // ** FINE HERE _w.output("do c twice, what happens?"); Assert.AreEqual(0, panelC.CountNotes()); Assert.AreEqual(0, panelB.CountNotes()); Assert.AreEqual(1, panelD.CountNotes()); lg.Instance.Loudness = Loud.ACRITICAL; _w.output("START COUNT SUB5"); NoteDataXML_RichText richy = new NoteDataXML_RichText(); richy.GuidForNote = "richy"; panel.AddNote(richy); richy.CreateParent(panel); panel.SaveLayout(); _w.output("do c THRICE, what happens?"); Assert.AreEqual(0, panelC.CountNotes()); _w.output("E COUNT SUB5"); // now move note into A _w.output("move richy FROM PANEL into PanelA (PanelA also holds PanelC). The exact logic seems to be that IN THE FOLLOWING MOVE, PANELA Gets Disposed of??!?"); panel.MoveNote(richy.GuidForNote, panelA.GuidForNote); panel.SaveLayout(); _w.output("do c 4x, what happens?"); Assert.AreEqual(0, panelC.CountNotes()); _w.output("done move richy"); Assert.AreEqual(3, panelA.CountNotes()); Assert.AreEqual(10, panel.CountNotes()); _w.output("countc"); Assert.AreEqual(0, panelC.CountNotes()); // * Jan 19 2013 - brok ehere _w.output("e countc"); _w.output("countb"); Assert.AreEqual(0, panelB.CountNotes()); _w.output("e countb"); _w.output("Panel A Notes " + panelA.CountNotes().ToString()); _w.output("Total Notes " + panel.CountNotes()); // also see if this test or another could replicate the problems I had in previous version with RefhresTabs panel.SaveLayout(); // now do a test to load it panel = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); //form.Controls.Add (panel); //form.Show (); //NOTE: For now remember that htis ADDS 1 Extra notes panel.LoadLayout("mynewpanel", false, null); _w.output("getting notes for " + panel.Caption); System.Collections.ArrayList TheNotes = panel.GetAllNotes(); // System.Collections.Generic.List<NoteDataInterface> list = new System.Collections.Generic.List<NoteDataInterface> (); //list.AddRange ((NoteDataInterface[])TheNotes.ToArray ()); int count = 0; foreach (NoteDataInterface note in TheNotes) { if (note.GuidForNote == CoreUtilities.Links.LinkTable.STICKY_TABLE) { count++; } } // make sure there is only one linktable Assert.AreEqual(1, count); //.NoteDataInterface[] found = (NoteDataInterface)list.Find (NoteDataInterface=>NoteDataInterface.GuidForNote == CoreUtilities.Links.LinkTable.STICKY_TABLE ); // Assert.True (false); }
public void TestThatChildInheritsKeywordsAndOtherDetailsOfParent() { System.Windows.Forms.Form form = new System.Windows.Forms.Form(); _TestSingleTon.Instance._SetupForLayoutPanelTests(); FAKE_LayoutPanel panel = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); form.Controls.Add(panel); form.Show(); //NOTE: For now remember that htis ADDS 1 Extra notes panel.NewLayout("mynewpanel", true, null); NoteDataXML basicNote = new NoteDataXML(); basicNote.Caption = "note1"; panel.AddNote(basicNote); //basicNote.CreateParent(panel); //panel.MoveNote( // create four panels A and B at root level. C inside A. D inside C FAKE_NoteDataXML_Panel panelA = new FAKE_NoteDataXML_Panel(); panelA.Caption = "PanelA"; panelA.GuidForNote = "panela"; FAKE_NoteDataXML_Panel panelB = new FAKE_NoteDataXML_Panel(); panelB.Caption = "PanelB"; panelB.GuidForNote = "panelb"; FAKE_NoteDataXML_Panel panelC = new FAKE_NoteDataXML_Panel(); panelC.Caption = "PanelC"; _w.output("panels made"); panel.AddNote(panelA); // 1 panel.AddNote(panelB); // 2 //panelA.CreateParent(panel); should not need to call this when doing LayoutPanel.AddNote because it calls CreateParent insid eof it basicNote = new NoteDataXML(); basicNote.Caption = "note2"; panelA.AddNote(basicNote); // Panel A has 1 note basicNote.CreateParent(panelA.myLayoutPanel()); // DO need to call it when adding notes like this (to a subpanel, I think) panel.SaveLayout(); Assert.AreEqual(1, panelA.CountNotes(), "Panel A holds one note"); // So this counts as + 2 // so we have (1 + 1 note on it)panel A + (1)panelB + basicNote +DefaultNote = 5 + (NEW) LinkTable = 6 Assert.AreEqual(6, panel.CountNotes(), "Total notes SHOULD BE 6 : (1 + 1 note on it)panel A + (1)panelB + basicNote +DefaultNote = 5 + (NEW) LinkTable = 6"); //COUNT SHOULD BE: panelA has 1 note //COUNT Total should be: Default Note + Note + PanelA + Panel B + (Note Inside Panel A) = 5 panelA.AddNote(panelC); // panelC is now part of Panel 2 panelC.CreateParent(panelA.myLayoutPanel()); panel.SaveLayout(); // NEED TO SAVE before conts will be accurated //COUNT SHOULD BE: panelA has 2 notes (Panel C + the Note I add) Assert.AreEqual(2, panelA.CountNotes(), "two notes in panelA"); Assert.AreEqual(7, panel.CountNotes(), "total of SEVEN notes"); Assert.AreEqual(0, panelB.CountNotes(), "0 count worked?"); // The Preamble Above is just standard creation // Now we want to test adjusting some fields panel.NotesForYou().Section = "thepanelsection"; panel.NotesForYou().Keywords = "fish,fries,in,the,sky"; panel.NotesForYou().Notebook = "freshnote"; panel.NotesForYou().Subtype = "thebestsub"; panel.SaveLayout(); // now reload panel = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); panel.LoadLayout("mynewpanel", false, null); panelA = null; panelB = null; panelA = (FAKE_NoteDataXML_Panel)panel.FindNoteByGuid("panela"); panelB = (FAKE_NoteDataXML_Panel)panel.FindNoteByGuid("panelb"); Assert.AreEqual(panel.GUID, panelA.GetParent_ParentGuid()); Assert.AreEqual(panel.GUID, panelB.GetParent_ParentGuid()); Assert.AreEqual(2, panelA.CountNotes(), "two notes in panelA"); Assert.AreEqual(7, panel.CountNotes(), "total of SEVEN notes"); Assert.AreEqual(0, panelB.CountNotes(), "0 count worked?"); // just make sure that the Parent itself got the changes we made!! Assert.AreEqual("thepanelsection", panel.NotesForYou().Section); Assert.AreEqual("fish,fries,in,the,sky", panel.NotesForYou().Keywords); Assert.AreEqual("freshnote", panel.NotesForYou().Notebook); Assert.AreEqual("thebestsub", panel.NotesForYou().Subtype); // now test the Children // this should FAIL utnil I write the needed code Assert.AreEqual("thepanelsection", panelA.GetParent_Section()); Assert.AreEqual("thepanelsection", panelB.GetParent_Section()); Assert.AreEqual("fish,fries,in,the,sky", panelA.GetParent_Keywords()); Assert.AreEqual("fish,fries,in,the,sky", panelB.GetParent_Keywords()); Assert.AreEqual("freshnote", panelA.GetParent_Notebook()); Assert.AreEqual("freshnote", panelB.GetParent_Notebook()); Assert.AreEqual("thebestsub", panelA.GetParent_Subtype()); Assert.AreEqual("thebestsub", panelB.GetParent_Subtype()); }
public void GetListOfLayoutTests() { _TestSingleTon.Instance._SetupForLayoutPanelTests(); System.Windows.Forms.Form form = new System.Windows.Forms.Form(); form.Show(); // March 2013 -- notelist relies on having this YOM2013.DefaultLayouts.CreateASystemLayout(form, null); string panelname2 = System.Guid.NewGuid().ToString(); FAKE_LayoutPanel PanelOtherGuy = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); PanelOtherGuy.NewLayout(panelname2, true, null); form.Controls.Add(PanelOtherGuy); PanelOtherGuy.SaveLayout(); Assert.AreEqual(2, PanelOtherGuy.CountNotes(), "count1"); List <MasterOfLayouts.NameAndGuid> names = MasterOfLayouts.GetListOfLayouts("WritingProjects"); Assert.AreEqual(0, names.Count); // 1 prtoject PanelOtherGuy = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); PanelOtherGuy.NewLayout("NextLayout", true, null); PanelOtherGuy.SetCaption("booler"); PanelOtherGuy.SetNotebookSection("Writing", "Projects"); form.Controls.Add(PanelOtherGuy); PanelOtherGuy.SaveLayout(); names = MasterOfLayouts.GetListOfLayouts("WritingProjects"); Assert.AreEqual(1, names.Count); // search LIKE NAME PanelOtherGuy = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); PanelOtherGuy.NewLayout("NextLayout22", true, null); PanelOtherGuy.SetCaption("boolAt"); LayoutDetails.Instance.AddToList(typeof(FAKE_NoteDataXML_Text), "textfake"); FAKE_NoteDataXML_Text richy = new FAKE_NoteDataXML_Text(); PanelOtherGuy.AddNote(richy); richy.CreateParent(PanelOtherGuy); richy.GetRichTextBox().Text = "Hello there"; PanelOtherGuy.SetNotebookSection("Writing", "Projects"); form.Controls.Add(PanelOtherGuy); PanelOtherGuy.SaveLayout(); PanelOtherGuy = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); PanelOtherGuy.NewLayout("NextLayout33", true, null); PanelOtherGuy.SetCaption("bolzzz"); PanelOtherGuy.SetNotebookSection("Writing", "Projects"); form.Controls.Add(PanelOtherGuy); PanelOtherGuy.SaveLayout(); names = MasterOfLayouts.GetListOfLayouts("WritingProjects"); Assert.AreEqual(3, names.Count); names = MasterOfLayouts.GetListOfLayouts("WritingProjects", "bool", false, null); Assert.AreEqual(2, names.Count); // // text searching // PanelOtherGuy = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); PanelOtherGuy.NewLayout("NextLayout55", true, null); PanelOtherGuy.SetCaption("bolzzz222"); PanelOtherGuy.SetNotebookSection("Writing", "Projects"); form.Controls.Add(PanelOtherGuy); PanelOtherGuy.SaveLayout(); richy = new FAKE_NoteDataXML_Text(); PanelOtherGuy.AddNote(richy); richy.CreateParent(PanelOtherGuy); richy.GetRichTextBox().Text = "Hello there again!"; PanelOtherGuy.SaveLayout(); richy = new FAKE_NoteDataXML_Text(); PanelOtherGuy.AddNote(richy); richy.CreateParent(PanelOtherGuy); richy.GetRichTextBox().Text = "Hello the fish are good there"; PanelOtherGuy.SaveLayout(); names = MasterOfLayouts.GetListOfLayouts("All", "fish", true, null); Assert.AreEqual(1, names.Count); // FINAL TEST now count all names = MasterOfLayouts.GetListOfLayouts("All"); Assert.AreEqual(6, names.Count); // now test to see if text in a subpanel is found correct FAKE_NoteDataXML_Panel subpanel = new FAKE_NoteDataXML_Panel(); PanelOtherGuy.AddNote(subpanel); subpanel.CreateParent(PanelOtherGuy); names = MasterOfLayouts.GetListOfLayouts("All", "sharks", true, null); Assert.AreEqual(0, names.Count); FAKE_NoteDataXML_Text Rich2 = new FAKE_NoteDataXML_Text(); subpanel.AddNote(Rich2); Rich2.GetRichTextBox().Text = "Sharks"; PanelOtherGuy.SaveLayout(); names = MasterOfLayouts.GetListOfLayouts("All", "sharks", true, null); Assert.AreEqual(1, names.Count); }
public void TestLinkTables() { System.Windows.Forms.Form form = new System.Windows.Forms.Form(); _TestSingleTon.Instance._SetupForLayoutPanelTests(); LayoutDetails.Instance.AddToList(typeof(FAKE_NoteDataPicture), "pictures"); FAKE_LayoutPanel panel = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); form.Controls.Add(panel); form.Show(); //NOTE: For now remember that htis ADDS 1 Extra notes panel.NewLayout("mynewpanel", true, null); NoteDataXML basicNote = new NoteDataXML(); basicNote.Caption = "note1"; panel.AddNote(basicNote); //basicNote.CreateParent(panel); //panel.MoveNote( FAKE_NoteDataXML_Panel panelA = new FAKE_NoteDataXML_Panel(); panelA.Caption = "PanelA"; FAKE_NoteDataXML_Panel panelB = new FAKE_NoteDataXML_Panel(); panelB.Caption = "PanelB"; panel.AddNote(panelA); panelA.CreateParent(panel); // b is inside A panelA.AddNote(panelB); panelB.CreateParent(panelA.GetPanelsLayout()); FAKE_NoteDataPicture picture = new FAKE_NoteDataPicture(); panelB.AddNote(picture); picture.CreateParent(panelB.GetPanelsLayout()); // add a few more pictures picture = new FAKE_NoteDataPicture(); panelB.AddNote(picture); picture.CreateParent(panelB.GetPanelsLayout()); picture = new FAKE_NoteDataPicture(); panelB.AddNote(picture); picture.CreateParent(panelB.GetPanelsLayout()); panel.SaveLayout(); // basic note + LINKTABLE + Default Note + Panel A + Panel B + Picture1 + Picture2 + Picture3= 8 Assert.AreEqual(8, panel.CountNotes()); // create several pictures, including in a subpanel, and then count linktables=1 CoreUtilities.Links.LinkTable panelLinkTable = panelB.GetPanelsLayout().GetLinkTable(); CoreUtilities.Links.LinkTable MainLinkTable = panel.GetLinkTable(); Assert.AreEqual(panelLinkTable, MainLinkTable); CoreUtilities.Links.LinkTable dodgeball = new CoreUtilities.Links.LinkTable(); Assert.AreNotEqual(MainLinkTable, dodgeball); //Assert.AreNotEqual(MainLinkTable, panelLinkTable); // moves one of the pictures out of the Folder B and into FolderA Assert.AreEqual(4, panelA.CountNotes()); panelB.myLayoutPanel().MoveNote(picture.GuidForNote, "up"); Assert.AreEqual(4, panelA.CountNotes()); // count should stay the same panelA.myLayoutPanel().MoveNote(picture.GuidForNote, "up"); Assert.AreEqual(3, panelA.CountNotes()); // now that the note is out the count should go down Assert.AreEqual(8, panel.CountNotes()); }
public void ExportImport() { lg.Instance.OutputToConstoleToo = true; Form form = new Form(); string ThisLayoutGUID = "mynewpanelXA"; // create a layout _TestSingleTon.Instance._SetupForLayoutPanelTests(); // _SetupForLayoutPanelTests (); FAKE_LayoutPanel panel = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); form.Controls.Add(panel); //NOTE: For now remember that htis ADDS 1 Extra notes panel.NewLayout(ThisLayoutGUID, true, null); NoteDataXML basicNote = new NoteDataXML(); basicNote.GuidForNote = "thisguid1"; basicNote.Caption = "note1"; panel.AddNote(basicNote); //basicNote.CreateParent (panel); panel.SaveLayout(); FAKE_NoteDataXML_Panel panelA = new FAKE_NoteDataXML_Panel(); panelA.Caption = "PanelA"; panelA.GuidForNote = "panela"; panel.AddNote(panelA); panelA.CreateParent(panel); FAKE_NoteDataXML_Panel panelB = new FAKE_NoteDataXML_Panel(); panelB.Caption = "PanelBBBBB2"; panelB.GuidForNote = "panelBB"; panelA.AddNote(panelB); panelB.CreateParent(panelA.GetPanelsLayout()); FAKE_NoteDataXML_Text textNoteA = new FAKE_NoteDataXML_Text(); panelB.AddNote(textNoteA); textNoteA.GuidForNote = "My Text Note For the B Panel"; textNoteA.CreateParent(panelB.GetPanelsLayout()); textNoteA.Caption = "My text B"; FAKE_NoteDataXML_Text textNote = new FAKE_NoteDataXML_Text(); panelA.AddNote(textNote); textNote.GuidForNote = "Text Note For Panel A"; textNote.CreateParent(panelA.GetPanelsLayout()); textNote.Caption = "My text A"; textNote.GetRichTextBox().Text = "Hello there." + Environment.NewLine + "I am still here, are you?" + Environment.NewLine + "Yep!"; panel.SaveLayout(); Assert.AreEqual(7, panel.CountNotes(), "Count1"); // Note count: Default Note + BasicNote+ PanelA + LinkTable + MyText + PanbelB + My Text B =7 //test existence Assert.True(MasterOfLayouts.ExistsByGUID(ThisLayoutGUID)); // counting our subpanel we have 2 Assert.AreEqual(3, MasterOfLayouts.Count(true)); // NOT counting our subpanel we have 1 Assert.AreEqual(1, MasterOfLayouts.Count(false)); // export string file = Path.Combine(Environment.CurrentDirectory, "exportest.txt"); if (File.Exists(file)) { File.Delete(file); } string subfile = file + "__child0.txt"; if (File.Exists(subfile)) { File.Delete(subfile); } string subfile2 = file + "__child1.txt"; if (File.Exists(subfile2)) { File.Delete(subfile2); } Assert.False(File.Exists(file), file + " does not exist"); MasterOfLayouts.ExportLayout(ThisLayoutGUID, file); // test exportfile existence // count 2 files exported Assert.True(File.Exists(file), "main file exists"); Assert.True(File.Exists(subfile), "subfile exists"); Assert.True(File.Exists(subfile2), "subfile2 exists"); // delete original note MasterOfLayouts.DeleteLayout(ThisLayoutGUID); // test existence Assert.False(MasterOfLayouts.ExistsByGUID(ThisLayoutGUID)); // counting our subpanel we have ZERO Assert.AreEqual(0, MasterOfLayouts.Count(true), "Nothing should be left"); // Import as New (but won't be duplicate because old is gone) int errorcode = MasterOfLayouts.ImportLayout(file); Console.WriteLine(errorcode); Assert.True(MasterOfLayouts.ExistsByGUID(ThisLayoutGUID)); // test existence // confirm all notes laoded into layout panel = null; panel = new FAKE_LayoutPanel(ThisLayoutGUID, false); form.Controls.Add(panel); panel.LoadLayout(ThisLayoutGUID, false, null); // panel.SaveLayout(); Assert.AreEqual(7, panel.CountNotes(), "Count2"); Assert.AreEqual(1, MasterOfLayouts.Count(false)); Assert.AreEqual(3, MasterOfLayouts.Count(true)); // Import as Overwrite if (File.Exists(file)) { File.Delete(file); } subfile = file + "__child0.txt"; if (File.Exists(subfile)) { File.Delete(subfile); } Assert.True(MasterOfLayouts.ExistsByGUID(ThisLayoutGUID)); MasterOfLayouts.ExportLayout(ThisLayoutGUID, file); panel = null; errorcode = MasterOfLayouts.ImportLayout(file); Assert.AreEqual(0, errorcode); // test existences panel = new FAKE_LayoutPanel(ThisLayoutGUID, false); form.Controls.Add(panel); panel.LoadLayout(ThisLayoutGUID, false, null); Assert.AreEqual(7, panel.CountNotes()); Assert.AreEqual(1, MasterOfLayouts.Count(false)); Assert.AreEqual(3, MasterOfLayouts.Count(true)); lg.Instance.OutputToConstoleToo = false; }
public void TableSearch() { // the way filters work for tables is weird // and becaue it is weird I might tweak it later and this is a bad idea // so I'm writing this test to stop me from doing that _TestSingleTon.Instance._SetupForLayoutPanelTests(); System.Windows.Forms.Form form = new System.Windows.Forms.Form(); // needed else DataGrid does not initialize form.Show(); //form.Visible = false; _w.output("boom"); // March 2013 -- notelist relies on having this YOM2013.DefaultLayouts.CreateASystemLayout(form, null); //NOTE: For now remember that htis ADDS 1 Extra notes string panelname2 = System.Guid.NewGuid().ToString(); FAKE_LayoutPanel PanelOtherGuy = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); PanelOtherGuy.NewLayout(panelname2, true, null); form.Controls.Add(PanelOtherGuy); PanelOtherGuy.SaveLayout(); Assert.AreEqual(2, PanelOtherGuy.CountNotes(), "count1"); // ADD 1 of each type //foreach (Type t in LayoutDetails.Instance.ListOfTypesToStoreInXML()) NoteDataXML_Table table = new NoteDataXML_Table(100, 100, new ColumnDetails[3] { new ColumnDetails("id", 100), new ColumnDetails("tables", 100), new ColumnDetails("values", 220) }); table.GuidForNote = "thetable"; table.Caption = "thettable2"; PanelOtherGuy.AddNote(table); table.CreateParent(PanelOtherGuy); // table.UpdateAfterLoad(); table.AddRow(new object[3] { "0", "table1", "value1" }); table.AddRow(new object[3] { "0", "table2", "value2" }); table.AddRow(new object[3] { "0", "table3", "value3" }); table.AddRow(new object[3] { "0", "table4", "value4" }); PanelOtherGuy.SaveLayout(); Assert.AreEqual(3, PanelOtherGuy.CountNotes(), "count2"); string ToSearchFor = "table3"; // looks in row 1 for the value and will return the value from row 2 List <string> results = PanelOtherGuy.GetListOfStringsFromSystemTable("thettable2", 2, String.Format("1|{0}", ToSearchFor)); Assert.NotNull(results); Assert.AreEqual(1, results.Count); Assert.AreEqual("value3", results[0]); ToSearchFor = "bacon"; results = PanelOtherGuy.GetListOfStringsFromSystemTable("thettable2", 2, String.Format("1|{0}", ToSearchFor)); Assert.NotNull(results); Assert.AreEqual(0, results.Count); ToSearchFor = "0"; results = PanelOtherGuy.GetListOfStringsFromSystemTable("thettable2", 1, String.Format("0|{0}", ToSearchFor)); Assert.NotNull(results); Assert.AreEqual(4, results.Count); }
public void AnEmptyPanelStillHasAParent() { lg.Instance.OutputToConstoleToo = true; Form form = new Form(); string ThisLayoutGUID = "mynewpanelXA"; // create a layout _TestSingleTon.Instance._SetupForLayoutPanelTests(); // _SetupForLayoutPanelTests (); FAKE_LayoutPanel panel = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); form.Controls.Add(panel); //NOTE: For now remember that htis ADDS 1 Extra notes panel.NewLayout(ThisLayoutGUID, true, null); NoteDataXML basicNote = new NoteDataXML(); basicNote.GuidForNote = "thisguid1"; basicNote.Caption = "note1"; panel.AddNote(basicNote); //basicNote.CreateParent (panel); panel.SaveLayout(); FAKE_NoteDataXML_Panel panelA = new FAKE_NoteDataXML_Panel(); panelA.Caption = "PanelA"; panelA.GuidForNote = "panela"; panel.AddNote(panelA); panelA.CreateParent(panel); FAKE_NoteDataXML_Panel panelB = new FAKE_NoteDataXML_Panel(); panelB.Caption = "PanelBBBBB"; panelB.GuidForNote = "panelBB"; panelA.AddNote(panelB); panelB.CreateParent(panelA.GetPanelsLayout()); FAKE_NoteDataXML_Text textNote = new FAKE_NoteDataXML_Text(); panelA.AddNote(textNote); textNote.CreateParent(panelA.GetPanelsLayout()); textNote.Caption = "My text"; textNote.GetRichTextBox().Text = "Hello there." + Environment.NewLine + "I am still here, are you?" + Environment.NewLine + "Yep!"; panel.SaveLayout(); Assert.AreEqual(6, panel.CountNotes()); _w.output(panelB.GetPanelsLayout().ParentGUID); // get parent GUID directlyf rom database FAKE_LayoutPanel SubPanelB = new FAKE_LayoutPanel("panelBB", true); form.Controls.Add(SubPanelB); SubPanelB.LoadLayout("panelBB", true, null); Assert.AreNotEqual(Constants.BLANK, SubPanelB.GetLayoutDatabase().ParentGuid); }
public void AutosaveThrash() { // just spawna timer and see if I can make it fail _TestSingleTon.Instance._SetupForLayoutPanelTests(); System.Windows.Forms.Form form = new System.Windows.Forms.Form(); panelAutosave = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); form.Controls.Add(panelAutosave); // needed else DataGrid does not initialize form.Show(); //form.Visible = false; _w.output("boom"); // March 2013 -- notelist relies on having this YOM2013.DefaultLayouts.CreateASystemLayout(form, null); //NOTE: For now remember that htis ADDS 1 Extra notes string panelname = System.Guid.NewGuid().ToString(); panelAutosave.NewLayout(panelname, true, null); LayoutDetails.Instance.AddToList(typeof(FAKE_NoteDataXML_Panel), "testingpanel"); _w.output("herefirst"); Timer SaveTimer = new Timer(); SaveTimer.Interval = 300; SaveTimer.Tick += HandleSaveTimerTick; SaveTimer.Start(); // ADD 1 of each type foreach (Type t in LayoutDetails.Instance.ListOfTypesToStoreInXML()) { for (int i = 0; i < 2; i++) { NoteDataInterface note = (NoteDataInterface)Activator.CreateInstance(t); panelAutosave.AddNote(note); note.CreateParent(panelAutosave); note.UpdateAfterLoad(); } } panelAutosave.SaveLayout(); // // Second panel // string panelname2 = System.Guid.NewGuid().ToString(); FAKE_LayoutPanel PanelOtherGuy = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); PanelOtherGuy.NewLayout(panelname2, true, null); PanelOtherGuy.SaveLayout(); Assert.AreEqual(2, PanelOtherGuy.CountNotes(), "count1"); // ADD 1 of each type //foreach (Type t in LayoutDetails.Instance.ListOfTypesToStoreInXML()) { for (int i = 0; i < 10; i++) { NoteDataInterface note = new NoteDataXML_RichText(); PanelOtherGuy.AddNote(note); note.CreateParent(PanelOtherGuy); note.UpdateAfterLoad(); } } Assert.AreEqual(12, PanelOtherGuy.CountNotes(), "count2"); PanelOtherGuy.SaveLayout(); PanelOtherGuy = null; PanelOtherGuy = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); PanelOtherGuy.LoadLayout(panelname2, false, null); Assert.AreEqual(12, PanelOtherGuy.CountNotes(), "count2"); // add another Layout and do something with it while autosave continues running SaveTimer.Stop(); form.Dispose(); }
public void CopyNoteTest() { _TestSingleTon.Instance._SetupForLayoutPanelTests(); System.Windows.Forms.Form form = new System.Windows.Forms.Form(); FAKE_LayoutPanel panelToUse = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); form.Controls.Add(panelToUse); // needed else DataGrid does not initialize form.Show(); //form.Visible = false; _w.output("boom"); // March 2013 -- notelist relies on having this YOM2013.DefaultLayouts.CreateASystemLayout(form, null); //NOTE: For now remember that htis ADDS 1 Extra notes string panelname = System.Guid.NewGuid().ToString(); panelToUse.NewLayout(panelname, true, null); LayoutDetails.Instance.AddToList(typeof(FAKE_NoteDataXML_Panel), "testingpanel"); _w.output("herefirst"); Timer SaveTimer = new Timer(); SaveTimer.Interval = 300; SaveTimer.Tick += HandleSaveTimerTick; SaveTimer.Start(); // ADD 1 of each type foreach (Type t in LayoutDetails.Instance.ListOfTypesToStoreInXML()) { for (int i = 0; i < 2; i++) { NoteDataInterface note = (NoteDataInterface)Activator.CreateInstance(t); panelToUse.AddNote(note); note.CreateParent(panelToUse); note.UpdateAfterLoad(); panelToUse.CopyNote(note); panelToUse.PasteNote(); } } panelToUse.SaveLayout(); //int propercount= 4 * LayoutDetails.Instance.ListOfTypesToStoreInXML().Length; Assert.AreEqual(46, panelToUse.CountNotes()); // // Now we test pasting one of our notes onto another Layout // string panelname2 = System.Guid.NewGuid().ToString(); FAKE_LayoutPanel PanelOtherGuy = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); PanelOtherGuy.NewLayout(panelname2, true, null); PanelOtherGuy.SaveLayout(); form.Controls.Add(PanelOtherGuy); Assert.AreEqual(2, PanelOtherGuy.CountNotes(), "count1"); // ADD 1 of each type //foreach (Type t in LayoutDetails.Instance.ListOfTypesToStoreInXML()) { for (int i = 0; i < 10; i++) { NoteDataInterface note = new NoteDataXML_RichText(); PanelOtherGuy.AddNote(note); note.CreateParent(PanelOtherGuy); note.UpdateAfterLoad(); } } Assert.AreEqual(12, PanelOtherGuy.CountNotes(), "count2"); PanelOtherGuy.PasteNote(); Assert.AreEqual(13, PanelOtherGuy.CountNotes(), "count2"); PanelOtherGuy.SaveLayout(); FAKE_NoteDataXML_Text Noter = new FAKE_NoteDataXML_Text(); Noter.Caption = "Hello there"; PanelOtherGuy.AddNote(Noter); Noter.GetRichTextBox().Text = "bear"; PanelOtherGuy.SaveLayout(); PanelOtherGuy.CopyNote(Noter); NoteDataXML_RichText CopyOfTextNote = (NoteDataXML_RichText)PanelOtherGuy.PasteNote(); Assert.AreEqual("Hello there", CopyOfTextNote.Caption); Assert.AreEqual("bear", CopyOfTextNote.GetRichTextBox().Text); // // // Table Copy Test // // NoteDataXML_Table randomTables = new NoteDataXML_Table(100, 100, new ColumnDetails[2] { new ColumnDetails("id", 100), new ColumnDetails("tables", 100) }); randomTables.Caption = LayoutDetails.SYSTEM_RANDOM_TABLES; // randomTables.Columns = new appframe.ColumnDetails[2]{new appframe.ColumnDetails("id",100), new appframe.ColumnDetails("tables",100)}; PanelOtherGuy.AddNote(randomTables); //randomTables.CreateParent(PanelOtherGuy); randomTables.AddRow(new object[2] { "1", "example|colors" }); randomTables.AddRow(new object[2] { "2", "example|colorPROMPTS" }); PanelOtherGuy.SaveLayout(); PanelOtherGuy.CopyNote(randomTables); NoteDataXML_Table CopyOfTable = (NoteDataXML_Table)PanelOtherGuy.PasteNote(); Assert.AreEqual(2, CopyOfTable.RowCount()); }
public void ArchiveAllAndCount() { lg.Instance.OutputToConstoleToo = true; Form form = new Form(); string ThisLayoutGUID = "mynewpanelXA"; // create a layout _TestSingleTon.Instance._SetupForLayoutPanelTests(); // _SetupForLayoutPanelTests (); FAKE_LayoutPanel panel = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); form.Controls.Add(panel); //NOTE: For now remember that htis ADDS 1 Extra notes panel.NewLayout(ThisLayoutGUID, true, null); NoteDataXML basicNote = new NoteDataXML(); basicNote.GuidForNote = "thisguid1"; basicNote.Caption = "note1"; panel.AddNote(basicNote); //basicNote.CreateParent (panel); panel.SaveLayout(); FAKE_NoteDataXML_Panel panelA = new FAKE_NoteDataXML_Panel(); panelA.Caption = "PanelA"; panelA.GuidForNote = "panela"; panel.AddNote(panelA); panelA.CreateParent(panel); FAKE_NoteDataXML_Panel panelB = new FAKE_NoteDataXML_Panel(); panelB.Caption = "PanelBBBBB2"; panelB.GuidForNote = "panelBB"; panelA.AddNote(panelB); panelB.CreateParent(panelA.GetPanelsLayout()); FAKE_NoteDataXML_Text textNoteA = new FAKE_NoteDataXML_Text(); panelB.AddNote(textNoteA); textNoteA.GuidForNote = "My Text Note For the B Panel"; textNoteA.CreateParent(panelB.GetPanelsLayout()); textNoteA.Caption = "My text B"; FAKE_NoteDataXML_Text textNote = new FAKE_NoteDataXML_Text(); panelA.AddNote(textNote); textNote.GuidForNote = "Text Note For Panel A"; textNote.CreateParent(panelA.GetPanelsLayout()); textNote.Caption = "My text A"; textNote.GetRichTextBox().Text = "Hello there." + Environment.NewLine + "I am still here, are you?" + Environment.NewLine + "Yep!"; panel.SaveLayout(); Assert.AreEqual(7, panel.CountNotes(), "Count1"); // Note count: Default Note + BasicNote+ PanelA + LinkTable + MyText + PanbelB + My Text B =7 //test existence Assert.True(MasterOfLayouts.ExistsByGUID(ThisLayoutGUID)); // counting our subpanel we have 2 Assert.AreEqual(3, MasterOfLayouts.Count(true)); // NOT counting our subpanel we have 1 Assert.AreEqual(1, MasterOfLayouts.Count(false)); LayoutDetails.Instance.CurrentLayout = panel; MefAddIns.Addin_Archive Archiver = new MefAddIns.Addin_Archive(); // delete existing files string path = Archiver.BuildArchiveDepotPath(); string[] files = Directory.GetFiles(path); foreach (string s in files) { File.Delete(s); } files = Directory.GetFiles(path); Assert.AreEqual(0, files.Length); Archiver.ArchiveAll(panel, "automatedtesting"); files = Directory.GetFiles(path); Assert.AreEqual(3, files.Length); }
public void TimelineAndTableAlwaysTogether() { _w.output("START"); System.Windows.Forms.Form form = new System.Windows.Forms.Form(); _TestSingleTon.Instance._SetupForLayoutPanelTests(); FAKE_LayoutPanel panel = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); form.Controls.Add(panel); form.Show(); //NOTE: For now remember that htis ADDS 1 Extra notes panel.NewLayout("mynewpanel", true, null); NoteDataXML basicNote = new NoteDataXML(); basicNote.Caption = "note1"; panel.AddNote(basicNote); //basicNote.CreateParent(panel); //panel.MoveNote( // create four panels A and B at root level. C inside A. D inside C FAKE_NoteDataXML_Panel panelA = new FAKE_NoteDataXML_Panel(); panelA.Caption = "PanelA"; panelA.GuidForNote = "panela"; FAKE_NoteDataXML_Panel panelB = new FAKE_NoteDataXML_Panel(); panelB.Caption = "PanelB"; panelB.GuidForNote = "panelb"; FAKE_NoteDataXML_Panel panelC = new FAKE_NoteDataXML_Panel(); panelC.Caption = "PanelC"; panelC.GuidForNote = "panelc"; _w.output("panels made"); panel.AddNote(panelA); // 1 panel.AddNote(panelB); // 2 //panelA.CreateParent(panel); should not need to call this when doing LayoutPanel.AddNote because it calls CreateParent insid eof it basicNote = new NoteDataXML(); basicNote.Caption = "note2"; panelA.AddNote(basicNote); // Panel A has 1 note basicNote.CreateParent(panelA.myLayoutPanel()); // DO need to call it when adding notes like this (to a subpanel, I think) panel.SaveLayout(); Assert.AreEqual(1, panelA.CountNotes(), "Panel A holds one note"); // So this counts as + 2 // so we have (1 + 1 note on it)panel A + (1)panelB + basicNote +DefaultNote = 5 + (NEW) LinkTable = 6 _w.output("STARTCOUNT"); Assert.AreEqual(6, panel.CountNotes(), "Total notes SHOULD BE 6 : (1 + 1 note on it)panel A + (1)panelB + basicNote +DefaultNote = 5 + (NEW) LinkTable = 6"); _w.output("ENDCOUNT"); // add timeline into a PANEL // count 1 row NoteDataXML_Timeline MyTimeLine = new NoteDataXML_Timeline(100, 100); MyTimeLine.Caption = "My Timeline!"; panelA.AddNote(MyTimeLine); MyTimeLine.CreateParent(panelA.GetPanelsLayout()); panel.SaveLayout(); // I needed this save else it would not work? Assert.AreEqual(8, panel.CountNotes(), "Total notes SHOULD BE 6 : (1 + 1 note on it)panel A + (1)panelB + basicNote +DefaultNote = 5 + (NEW) LinkTable = 6"); string guidOfTimeline = MyTimeLine.GuidForNote; string guidOfTimelineTable = guidOfTimeline + "table"; NoteDataXML_Table FoundTable = (NoteDataXML_Table)panel.FindNoteByGuid(guidOfTimelineTable); Assert.NotNull(FoundTable); Assert.AreEqual(1, FoundTable.RowCount()); FoundTable = null; // move the TABLE associated with the timeline OUT to parent // count 1 row panelA.myLayoutPanel().MoveNote(guidOfTimelineTable, "up"); // And for kicks add another timeline just to see if it messages anytnig up NoteDataXML_Timeline MyTimeLine2 = new NoteDataXML_Timeline(100, 1020); MyTimeLine2.Caption = "My Timeline! #2"; panel.AddNote(MyTimeLine2); panel.SaveLayout(); Assert.AreEqual(10, panel.CountNotes(), "Total notes SHOULD BE 6 : (1 + 1 note on it)panel A + (1)panelB + basicNote +DefaultNote = 5 + (NEW) LinkTable = 6"); Assert.Null(FoundTable); FoundTable = (NoteDataXML_Table)panel.FindNoteByGuid(guidOfTimelineTable); Assert.NotNull(FoundTable); Assert.AreEqual(1, FoundTable.RowCount()); // move the TABLE into ANOTHER panel // count 1 row _w.output("Moving into panelb now"); panel.MoveNote(guidOfTimelineTable, "panelb"); panel.SaveLayout(); Assert.AreEqual(10, panel.CountNotes(), "Total notes SHOULD BE 6 : (1 + 1 note on it)panel A + (1)panelB + basicNote +DefaultNote = 5 + (NEW) LinkTable = 6"); _w.output("done counting"); FoundTable = null; Assert.Null(FoundTable); FoundTable = (NoteDataXML_Table)panel.FindNoteByGuid(guidOfTimelineTable); Assert.NotNull(FoundTable); Assert.AreEqual(1, FoundTable.RowCount()); form.Dispose(); }