/// <summary> /// Encodes the given location. /// </summary> /// <param name="location"></param> /// <returns></returns> public override string Encode(ReferencedLocation location) { if (location == null) { throw new ArgumentNullException("location"); } if (location is ReferencedLine) { return(this.Encode(location as ReferencedLine)); } else if (location is ReferencedPointAlongLine) { return(this.Encode(location as ReferencedPointAlongLine)); } throw new ArgumentOutOfRangeException("location", string.Format("Location cannot be encoded by any of the encoders: {0}", location.ToString())); }
/// <summary> /// Creates a new referenced encoding exception. /// </summary> /// <param name="location"></param> /// <param name="message"></param> public ReferencedEncodingException(ReferencedLocation location, string message) : base(message) { _referencedLocation = location; }