public GEDCOMSourceCitation AddSource(GEDCOMSourceRecord sourceRec, string page, int quality) { GEDCOMSourceCitation cit = null; if (sourceRec != null) { cit = new GEDCOMSourceCitation(Owner, this, "", ""); cit.Value = sourceRec; cit.Page = page; cit.CertaintyAssessment = quality; SourceCitations.Add(cit); } return(cit); }
public float GetCertaintyAssessment() { float result = 0; float wsum = 0; int num1 = fEvents.Count; for (int i = 0; i < num1; i++) { GEDCOMCustomEvent evt = fEvents[i]; int num2 = evt.SourceCitations.Count; for (int k = 0; k < num2; k++) { GEDCOMSourceCitation cit = evt.SourceCitations[k]; int ca = CheckCA(cit.CertaintyAssessment); int weight = (ca + 1); result += (CA_VALUES[ca] * weight); wsum += weight; } } int num3 = SourceCitations.Count; for (int i = 0; i < num3; i++) { GEDCOMSourceCitation cit = SourceCitations[i]; int ca = CheckCA(cit.CertaintyAssessment); int weight = (ca + 1); result += (CA_VALUES[ca] * weight); wsum += weight; } if (wsum != 0.0f) { result /= wsum; } else { result = 0.0f; } return(result); }
public override void Assign(GEDCOMTag source) { GEDCOMRecord sourceRec = source as GEDCOMRecord; if (sourceRec == null) { throw new ArgumentException(@"Argument is null or wrong type", "source"); } base.Assign(source); foreach (GEDCOMNotes sourceNote in sourceRec.fNotes) { GEDCOMNotes copy = (GEDCOMNotes)GEDCOMNotes.Create(Owner, this, "", ""); copy.Assign(sourceNote); Notes.Add(copy); } foreach (GEDCOMMultimediaLink sourceMediaLink in sourceRec.fMultimediaLinks) { GEDCOMMultimediaLink copy = (GEDCOMMultimediaLink)GEDCOMMultimediaLink.Create(Owner, this, "", ""); copy.Assign(sourceMediaLink); MultimediaLinks.Add(copy); } foreach (GEDCOMSourceCitation sourceSrcCit in sourceRec.fSourceCitations) { GEDCOMSourceCitation copy = (GEDCOMSourceCitation)GEDCOMSourceCitation.Create(Owner, this, "", ""); copy.Assign(sourceSrcCit); SourceCitations.Add(copy); } foreach (GEDCOMUserReference sourceUserRef in sourceRec.fUserReferences) { GEDCOMUserReference copy = (GEDCOMUserReference)GEDCOMUserReference.Create(Owner, this, "", ""); copy.Assign(sourceUserRef); UserReferences.Add(copy); } }