public bool DeleteRepositoryRecord(GEDCOMRepositoryRecord repRec) { if (repRec == null) { return(false); } int num = fRecords.Count; for (int i = 0; i < num; i++) { GEDCOMRecord rec = this[i]; if (rec.RecordType == GEDCOMRecordType.rtSource) { GEDCOMSourceRecord srcRec = (GEDCOMSourceRecord)rec; for (int j = srcRec.RepositoryCitations.Count - 1; j >= 0; j--) { if (srcRec.RepositoryCitations[j].Value == repRec) { srcRec.RepositoryCitations.Delete(srcRec.RepositoryCitations[j]); } } } } DeleteRecord(repRec); return(true); }
public GEDCOMRepositoryRecord CreateRepository() { GEDCOMRepositoryRecord result = new GEDCOMRepositoryRecord(this, this, "", ""); result.InitNew(); result.ChangeDate.ChangeDateTime = DateTime.Now; AddRecord(result); return(result); }
public GEDCOMRepositoryCitation AddRepository(GEDCOMRepositoryRecord repRec) { GEDCOMRepositoryCitation cit = null; if (repRec != null) { cit = new GEDCOMRepositoryCitation(Owner, this, "", ""); cit.Value = repRec; RepositoryCitations.Add(cit); } return(cit); }
public void RemoveRepository(GEDCOMRepositoryRecord repRec) { if (repRec == null) { throw new ArgumentNullException("repRec"); } foreach (GEDCOMRepositoryCitation repCit in fRepositoryCitations) { GEDCOMRepositoryRecord rep = repCit.Value as GEDCOMRepositoryRecord; if (rep == repRec) { fRepositoryCitations.Delete(repCit); break; } } }