Exemplo n.º 1
0
        public DvDateTime Subtract(DvDuration duration)
        {
            Iso8601Duration isoDuration = new Iso8601Duration(duration.Value);
            Iso8601DateTime newDateTime = this.isoDateTime.Subtract(isoDuration);

            return(new DvDateTime(newDateTime.ToString()));
        }
Exemplo n.º 2
0
        public override DvAbsoluteQuantity <DvDateTime, DvDuration> Subtract(DvAmount <DvDuration> b)
        {
            DesignByContract.Check.Require(b is DvDuration, "b object must be a DvDuration instance");

            DvDuration duration = b as DvDuration;

            return(this.Subtract(duration));
        }
Exemplo n.º 3
0
        public DvDateTime(string dateTimeString, DvDuration accuracy, string magnitudeStatus, CodePhrase normalStatus,
                          DvInterval <DvDateTime> normalRange, ReferenceRange <DvDateTime>[] otherReferenceRanges)
        {
            this.isoDateTime = new Iso8601DateTime(dateTimeString);

            base.SetBaseData(accuracy, magnitudeStatus, normalStatus, normalRange, otherReferenceRanges);

            CheckInvariants();
        }
Exemplo n.º 4
0
        public override DvAbsoluteQuantity <DvDate, DvDuration> Add(DvAmount <DvDuration> b)
        {
            DesignByContract.Check.Require(b is DvDuration, "b object must be a DvDuration instance");

            DvDuration duration = b as DvDuration;

            Iso8601Duration isoDuration = new Iso8601Duration(duration.Value);
            Iso8601Date     newIsoDate  = this.isoDate.Add(isoDuration);

            return(new DvDate(newIsoDate.ToString()));
        }
Exemplo n.º 5
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            if (reader.LocalName == "accuracy")
            {
                this.accuracy = new DvDuration();
                this.accuracy.ReadXml(reader);
            }

            reader.MoveToContent();
        }
Exemplo n.º 6
0
        public DvDate(string dateString, DvDuration accuracy, string magnitudeStatus, CodePhrase normalStatus,
                      DvInterval <DvDate> normalRange, ReferenceRange <DvDate>[] otherReferenceRanges)
            : this()
        {
            Check.Require(Iso8601Date.ValidIso8601Date(dateString), "Date string(" + dateString + ") must be a valid ISO 8601 date.");

            this.isoDate = new Iso8601Date(dateString);

            base.SetBaseData(accuracy, magnitudeStatus, normalStatus, normalRange, otherReferenceRanges);

            CheckInvariants();
        }
Exemplo n.º 7
0
 protected void SetBaseData(DvDuration accuracy, string magnitudeStatus, CodePhrase normalStatus, DvInterval <T> normalRange,
                            ReferenceRange <T>[] otherReferenceRanges)
 {
     this.accuracy = accuracy;
     base.SetBaseData(magnitudeStatus, normalStatus, normalRange, otherReferenceRanges);
 }