/// <summary> /// Creates a new Url instance based on a given URI and a description. /// </summary> /// <param name="address">URL to refer to.</param> /// <param name="description">Description for the URL.</param> public Url(string address, string description) { if (address == null) { throw new ArgumentNullException("address"); } if (!Uri.IsWellFormedUriString(address, UriKind.Absolute)) { throw RuntimeErrors.InvalidUriSpecified(); } _address = address; _description = description ?? ""; }
public UrlValue(string url, string description) { _urlValue = new SPFieldUrlValue(); if (url != null) { if (!Uri.IsWellFormedUriString(url, UriKind.Absolute)) { throw RuntimeErrors.InvalidUriSpecified(); } _urlValue.Url = url; _urlValue.Description = description; } }