示例#1
0
        private static bool CheckRecordXRef(GDMRecord record)
        {
            string stdSign = GEDCOMUtils.GetSignByRecord(record);
            string xrefNum = record.GetXRefNum();
            string recXRef = record.XRef;

            return((recXRef == stdSign + xrefNum) && record.GetId() >= 0);
        }
示例#2
0
        public string XRefIndex_NewXRef(GDMRecord record)
        {
            var    invNFI = GEDCOMUtils.InvariantNumberFormatInfo;
            string sign   = GEDCOMUtils.GetSignByRecord(record);
            string xref;

            int recType = (int)record.RecordType;
            int lastId  = fLastIDs[recType];

            do
            {
                lastId++;
                xref = sign + lastId.ToString(invNFI);
            } while (fXRefIndex.ContainsKey(xref));

            fLastIDs[recType] = lastId;
            return(xref);
        }
示例#3
0
 public void Test_GetSignByRecord()
 {
     Assert.AreEqual(string.Empty, GEDCOMUtils.GetSignByRecord(null));
 }