/// <summary> /// Adds an era. /// </summary> /// <param name="identifier">The identifier.</param> /// <param name="name">The name.</param> /// <param name="begin">The beginning date.</param> /// <param name="end">The ending date.</param> /// <exception cref="System.ArgumentException"> /// The beginning date has a different reference system to the eras. /// or /// The ending date has a different reference system to the eras. /// </exception> public void AddEra(String identifier, String name, Positioning.DateAndTime begin, Positioning.DateAndTime end) { if (!Begin.ReferenceSystem.Equals(begin.ReferenceSystem)) { throw new ArgumentException("The beginning date has a different reference system to the era.", "begin"); } if (!Begin.ReferenceSystem.Equals(end.ReferenceSystem)) { throw new ArgumentException("The ending date has a different reference system to the era.", "end"); } OrdinalEra era = new OrdinalEra(identifier, name, this.ReferenceSystem, begin, end); era._group = this; _eras.Add(era); }
/// <summary> /// Adds an era. /// </summary> /// <param name="identifier">The identifier.</param> /// <param name="name">The name.</param> /// <param name="begin">The beginning date.</param> /// <param name="end">The ending date.</param> /// <exception cref="System.ArgumentException"> /// The beginning date has a different reference system to the eras. /// or /// The ending date has a different reference system to the eras. /// </exception> public void AddEra(String identifier, String name, DateAndTime begin, Positioning.DateAndTime end) { if (_beginEndReferenceSystem == null) { _beginEndReferenceSystem = begin.ReferenceSystem; } if (!_beginEndReferenceSystem.Equals(begin.ReferenceSystem)) { throw new ArgumentException("The beginning date has a different reference system to the eras.", "begin"); } if (!_beginEndReferenceSystem.Equals(end.ReferenceSystem)) { throw new ArgumentException("The ending date has a different reference system to the eras.", "end"); } _eras.Add(new OrdinalEra(identifier, name, this, begin, end)); }