/// <summary> /// Gets the child notes. /// </summary> public override System.Collections.ArrayList GetChildNotes() { LayoutDatabase layout = new LayoutDatabase(this.GuidForNote); layout.LoadFrom(null); return(layout.GetAllNotes()); }
/// <summary> /// Lists the of subnotes as notes. For faster access to the subnotes of a subpanel. (September 16 2013) /// </summary> /// <returns> /// The of subnotes as notes. /// </returns> public override System.Collections.Generic.List <NoteDataInterface> ListOfSubnotesAsNotes() { System.Collections.Generic.List <NoteDataInterface> output = new System.Collections.Generic.List <NoteDataInterface> (); LayoutDatabase layout = new LayoutDatabase(this.GuidForNote); layout.LoadFrom(null); foreach (NoteDataInterface note in layout.GetAllNotes()) { output.Add(note); } return(output); }
public void CountSpecificSubType() { //-- do unit tests counting store 6 textboxes and know this (countbytype) System.Windows.Forms.Form form = new System.Windows.Forms.Form(); _TestSingleTon.Instance._SetupForLayoutPanelTests(); int count = 25; // FakeLayoutDatabase layout = new FakeLayoutDatabase ("testguid"); FAKE_LayoutPanel layoutPanel = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); layoutPanel.NewLayout("testguid", true, null); // jan152013 - tweak to allow this to work with new system without rewriting all the tstings in LayoutDatabasetest LayoutDatabase layout = layoutPanel.GetLayoutDatabase(); form.Controls.Add(layoutPanel); form.Show(); NoteDataXML note = new NoteDataXML(); for (int i = 0; i < count; i++) { note.Caption = "boo" + i.ToString(); layout.Add(note); note.CreateParent(layoutPanel); } _w.output(String.Format("{0} Notes in Layout before save", layout.GetNotes().Count.ToString())); for (int i = 0; i < 6; i++) { note = new NoteDataXML_RichText(); note.Caption = "richText"; layout.Add(note); note.CreateParent(layoutPanel); } layout.SaveTo(); // _w.output(String.Format ("{0} Objects Saved", layout.ObjectsSaved().ToString())); layout = new FakeLayoutDatabase("testguid"); layout.LoadFrom(layoutPanel); // now count RichText notes int count2 = 0; foreach (NoteDataInterface _note in layout.GetNotes()) { if (_note.GetType() == typeof(NoteDataXML_RichText)) { count2++; } } _w.output(String.Format("{0} Objects Loaded", layout.GetNotes().Count)); // added linktable Assert.AreEqual(7, count2); }