protected override void InternalGenerate() { IColor clrBlack = AppHost.GfxProvider.CreateColor(0x000000); fTitleFont = fWriter.CreateFont("", 22f, true, false, clrBlack); fTextFont = fWriter.CreateFont("", 10f, false, false, clrBlack); fHeaderFont = fWriter.CreateFont("", 12f, true, false, clrBlack); fWriter.AddParagraph(fTitle, fTitleFont, TextAlignment.taLeft); fWriter.NewLine(); var places = new StringList(); TreeTools.SearchPlaces(fBase.Context.Tree, places, AppHost.Progress, false); places.Sort(); fWriter.BeginTable(1, places.Count + 1); fWriter.BeginTableRow(true); fWriter.AddTableCell(SRLangMan.LS(RLS.LSID_Name), fHeaderFont, TextAlignment.taLeft); fWriter.EndTableRow(); for (int i = 0; i < places.Count; i++) { PlaceObj placeObj = (PlaceObj)places.GetObject(i); fWriter.BeginTableRow(false); fWriter.AddTableCell(placeObj.Name, fTextFont, TextAlignment.taLeft); fWriter.EndTableRow(); } fWriter.EndTable(); }
public void Test_SearchPlaces() { Assert.Throws(typeof(ArgumentNullException), () => { TreeTools.SearchPlaces_Clear(null); }); StringList placesList = new StringList(); Assert.Throws(typeof(ArgumentNullException), () => { TreeTools.SearchPlaces(null, null, null); }); Assert.Throws(typeof(ArgumentNullException), () => { TreeTools.SearchPlaces(fBaseWin.Context.Tree, null, null); }); Assert.Throws(typeof(ArgumentNullException), () => { TreeTools.SearchPlaces(fBaseWin.Context.Tree, placesList, null); }); TreeTools.SearchPlaces(fBaseWin.Context.Tree, placesList, AppHost.Progress); Assert.IsTrue(placesList.IndexOf("Ivanovo") >= 0); // <- TestStubs Assert.IsTrue(placesList.IndexOf("unknown") >= 0); // <- TestStubs Assert.IsTrue(placesList.IndexOf("Far Forest") >= 0); // <- TestStubs }
public void CheckPlaces() { fView.PlacesList.BeginUpdate(); try { TreeTools.SearchPlaces(fBase.Context.Tree, fPlaces, AppHost.Progress); fView.PlacesList.ClearItems(); int num4 = fPlaces.Count; for (int i = 0; i < num4; i++) { PlaceObj placeObj = (PlaceObj)fPlaces.GetObject(i); fView.PlacesList.AddItem(placeObj, new object[] { fPlaces[i], placeObj.Facts.Count }); } } finally { fView.PlacesList.EndUpdate(); } }
private void CheckPlaces() { ListPlaces.BeginUpdate(); try { TreeTools.SearchPlaces(fTree, fPlaces, AppHost.Progress); ListPlaces.ClearItems(); int num4 = fPlaces.Count; for (int i = 0; i < num4; i++) { PlaceObj placeObj = (PlaceObj)fPlaces.GetObject(i); ListPlaces.AddItem(placeObj, new object[] { fPlaces[i], placeObj.Facts.Count }); } } finally { ListPlaces.EndUpdate(); } }