public static IsWellFormedUriString ( string uriString, UriKind uriKind ) : bool | ||
uriString | string | |
uriKind | UriKind | |
return | bool |
public static bool IsWellFormedUriString(string uriString, UriKind uriKind)
{
Uri result;
if (!Uri.TryCreate(uriString, uriKind, out result))
return false;
return result.IsWellFormedOriginalString();
}
public void AddImage(string imageUrl) { if (!Uri.IsWellFormedUriString(imageUrl, UriKind.Absolute)) { return; } string msgToAdd = string.Format(IMG_CONVO_FMT_IN, imageUrl); AddConvoMessage(msgToAdd); }