public void SelectPlaces() { GDMIndividualRecord ind = null; bool condBirth = false; bool condDeath = false; bool condResidence = false; if (fView.TotalRadio.Checked) { condBirth = fView.BirthCheck.Checked; condDeath = fView.DeathCheck.Checked; condResidence = fView.ResidenceCheck.Checked; } else if (fView.SelectedRadio.Checked && (fView.PersonsCombo.SelectedIndex >= 0)) { ind = (fView.PersonsCombo.GetSelectedTag <GDMIndividualRecord>()); } fView.MapBrowser.ShowLines = (ind != null && fView.LinesVisibleCheck.Checked); fMapPoints.Clear(); int num = fPlaces.Count; for (int i = 0; i < num; i++) { MapPlace place = fPlaces[i]; if (place.Points.Count < 1) { continue; } int num2 = place.PlaceRefs.Count; for (int j = 0; j < num2; j++) { var placeRef = place.PlaceRefs[j]; GDMCustomEvent evt = placeRef.Event; var evtType = evt.GetTagType(); bool checkEventType = (condBirth && evtType == GEDCOMTagType.BIRT) || (condDeath && evtType == GEDCOMTagType.DEAT) || (condResidence && evtType == GEDCOMTagType.RESI); if ((ind != null && (placeRef.Owner == ind)) || checkEventType) { PlacesLoader.AddPoint(fMapPoints, place.Points[0], placeRef); } } } if (ind != null) { // sort points by date fMapPoints.QuickSort(MapPointsCompare); } PlacesLoader.CopyPoints(fView.MapBrowser, fMapPoints, ind != null); }
public void Test_CopyPoints() { var mapBrowser = Substitute.For <IMapBrowser>(); Assert.Throws(typeof(ArgumentNullException), () => { PlacesLoader.CopyPoints(mapBrowser, null, true); }); var gmapPoints = new ExtList <GeoPoint>(); gmapPoints.Add(new GeoPoint(0, 0, "test")); PlacesLoader.CopyPoints(mapBrowser, gmapPoints, true); }
private void btnSelectPlaces_Click(object sender, EventArgs e) { GEDCOMIndividualRecord ind = null; bool condBirth = false; bool condDeath = false; bool condResidence = false; if (radTotal.Checked) { condBirth = chkBirth.Checked.GetValueOrDefault(); condDeath = chkDeath.Checked.GetValueOrDefault(); condResidence = chkResidence.Checked.GetValueOrDefault(); } else if (radSelected.Checked && (cmbPersons.SelectedIndex >= 0)) { GKComboItem item = (GKComboItem)cmbPersons.Items[cmbPersons.SelectedIndex]; ind = (item.Tag as GEDCOMIndividualRecord); } fMapBrowser.ShowLines = (ind != null && chkLinesVisible.Checked.GetValueOrDefault()); fMapPoints.Clear(); int num = fPlaces.Count; for (int i = 0; i < num; i++) { MapPlace place = fPlaces[i]; if (place.Points.Count < 1) { continue; } int num2 = place.PlaceRefs.Count; for (int j = 0; j < num2; j++) { GEDCOMCustomEvent evt = place.PlaceRefs[j].Event; if ((ind != null && (evt.Parent == ind)) || (condBirth && evt.Name == "BIRT") || (condDeath && evt.Name == "DEAT") || (condResidence && evt.Name == "RESI")) { PlacesLoader.AddPoint(fMapPoints, place.Points[0], place.PlaceRefs[j]); } } } if (ind != null) { // sort points by date fMapPoints.QuickSort(MapPointsCompare); } PlacesLoader.CopyPoints(fMapBrowser, fMapPoints, ind != null); }
public void SelectPlaces() { GEDCOMIndividualRecord ind = null; bool condBirth = false; bool condDeath = false; bool condResidence = false; if (fView.TotalRadio.Checked) { condBirth = fView.BirthCheck.Checked; condDeath = fView.DeathCheck.Checked; condResidence = fView.ResidenceCheck.Checked; } else if (fView.SelectedRadio.Checked && (fView.PersonsCombo.SelectedIndex >= 0)) { ind = (fView.PersonsCombo.SelectedTag as GEDCOMIndividualRecord); } fView.MapBrowser.ShowLines = (ind != null && fView.LinesVisibleCheck.Checked); fMapPoints.Clear(); int num = fPlaces.Count; for (int i = 0; i < num; i++) { MapPlace place = fPlaces[i]; if (place.Points.Count < 1) { continue; } int num2 = place.PlaceRefs.Count; for (int j = 0; j < num2; j++) { GEDCOMCustomEvent evt = place.PlaceRefs[j].Event; if ((ind != null && (evt.Parent == ind)) || (condBirth && evt.Name == "BIRT") || (condDeath && evt.Name == "DEAT") || (condResidence && evt.Name == "RESI")) { PlacesLoader.AddPoint(fMapPoints, place.Points[0], place.PlaceRefs[j]); } } } if (ind != null) { // sort points by date fMapPoints.QuickSort(MapPointsCompare); } PlacesLoader.CopyPoints(fView.MapBrowser, fMapPoints, ind != null); }