コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UriParts"/> class with the provided URI.
 /// </summary>
 /// <param name="uriString">The URI string.</param>
 public UriParts(string uriString)
 {
     _rawString = uriString;
     UriScheme uriScheme = new UriScheme(_rawString);
     _scheme = uriScheme.SchemeType;
     _uriWithoutScheme = _rawString.Replace(uriScheme.Prefix, string.Empty);
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UriParts"/> class with the Current.Request.RawUrl.
 /// </summary>
 public UriParts()
 {
     _rawString = HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.RawUrl.TrimEnd('/');
     UriScheme uriScheme = new UriScheme(_rawString);
     _scheme = uriScheme.SchemeType;
     _uriWithoutScheme = _rawString.Replace(uriScheme.Prefix, string.Empty);
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UriScheme"/> class.
 /// </summary>
 /// <param name="uriSchemeType">Type of the URI scheme.</param>
 public UriScheme(UriSchemeType uriSchemeType)
 {
     switch (uriSchemeType)
     {
         case UriSchemeType.Http:
             _prefix = HTTP + DELIMITER;
             break;
         case UriSchemeType.Https:
             _prefix = HTTPS + DELIMITER;
             break;
         case UriSchemeType.Ftp:
             _prefix = FTP + DELIMITER;
             break;
         case UriSchemeType.Mailto:
             _prefix = MAILTO + ":";
             break;
         default:
             _prefix = string.Empty;
             break;
     }
 }