Example #1
0
 public override void SetDateTime(DateTime value)
 {
     if (fValue != null)
     {
         fValue.SetDateTime(value);
     }
     else
     {
         fValue      = new GDMDate();
         fValue.Date = value;
     }
 }
Example #2
0
        public override string ParseString(string strValue)
        {
            try {
                if (fValue != null)
                {
                    fValue.Dispose();
                    fValue = null;
                }

                return(string.IsNullOrEmpty(strValue) ? string.Empty : GEDCOMUtils.ParseDateValue(null, this, strValue));
            } catch (Exception ex) {
                Logger.WriteError("GDMDateValue.ParseString(\"" + strValue + "\")", ex);
                return(strValue);
            }
        }
Example #3
0
        public override string ParseString(string strValue)
        {
            try {
                if (fValue != null)
                {
                    fValue.Dispose();
                    fValue = null;
                }

                return(string.IsNullOrEmpty(strValue) ? string.Empty : GEDCOMUtils.ParseDateValue(GetTree(), this, strValue));
            } catch (Exception ex) {
                Logger.LogWrite("GEDCOMDateValue.ParseString(\"" + strValue + "\"): " + ex.Message);
                return(strValue);
            }
        }
Example #4
0
        public void Test_Misc()
        {
            GDMDate dtx1 = new GDMDate(null);

            dtx1.ParseString("20 JAN 2013");

            GDMDate dtx2 = new GDMDate(null);

            dtx2.ParseString("20 JAN 2014");

            var dtA = GDMCustomDate.CreateApproximated(null, dtx1, GDMApproximated.daCalculated);

            Assert.IsNotNull(dtA);
            Assert.AreEqual(GDMApproximated.daCalculated, dtA.Approximated);
            dtA.GetHashCode();

            var dtP = GDMCustomDate.CreatePeriod(null, dtx1, dtx2);

            Assert.IsNotNull(dtP);

            var dtR = GDMCustomDate.CreateRange(null, dtx1, dtx2);

            Assert.IsNotNull(dtR);
        }
Example #5
0
 public GDMDateValue()
 {
     fValue = null;
 }
Example #6
0
 /// <summary>
 /// Internal helper method for parser
 /// </summary>
 internal void SetRawData(GDMCustomDate value)
 {
     fValue = value;
 }
Example #7
0
 public GDMDateValue(GDMObject owner) : base(owner)
 {
     fValue = null;
 }