/// <summary> /// Creates a new <see cref="BlobUri" /> using the specified <see cref="string" /> instance. /// </summary> /// <param name="url">The <see cref="String" /> representing the <see cref="BlobUri" />.</param> /// <param name="blobUri">When this method returns, contains the constructed <see cref="BlobUri" />.</param> /// <returns>true if the <see cref="BlobUri" /> was successfully created; otherwise, false.</returns> public static bool TryParse(string url, out BlobUri blobUri) { blobUri = null; if (String.IsNullOrEmpty(url)) return false; var urlMatch = BlobAddressRegex.Match(url); if (!urlMatch.Success) return false; blobUri = new BlobUri { ContainerUri = new Uri(String.Format(CultureInfo.InvariantCulture, "http{0}://{1}", urlMatch.Groups["secure"].Value, urlMatch.Groups["containerUrl"].Value)), AccountName = urlMatch.Groups["accountName"].Value, AccountKey = urlMatch.Groups["accountKey"].Value, BlobName = urlMatch.Groups["blobName"].Value }; return true; }