Exemplo n.º 1
0
 public static string GetLeftPart(this Uri uri, UriPartial partial)
 {
     if (partial == UriPartial.Authority)
         return uri.Scheme + uri.Host + uri.Port;
     else
         return null;
 }
Exemplo n.º 2
0
        public string GetLeftPart(UriPartial part)
        {
            switch (part)
            {
            case UriPartial.Scheme:
                return(this.scheme + this.GetOpaqueWiseSchemeDelimiter());

            case UriPartial.Authority:
            {
                if (this.host == string.Empty || this.scheme == Uri.UriSchemeMailto || this.scheme == Uri.UriSchemeNews)
                {
                    return(string.Empty);
                }
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.Append(this.scheme);
                stringBuilder.Append(this.GetOpaqueWiseSchemeDelimiter());
                if (this.path.Length > 1 && this.path[1] == ':' && Uri.UriSchemeFile == this.scheme)
                {
                    stringBuilder.Append('/');
                }
                if (this.userinfo.Length > 0)
                {
                    stringBuilder.Append(this.userinfo).Append('@');
                }
                stringBuilder.Append(this.host);
                int defaultPort = Uri.GetDefaultPort(this.scheme);
                if (this.port != -1 && this.port != defaultPort)
                {
                    stringBuilder.Append(':').Append(this.port);
                }
                return(stringBuilder.ToString());
            }

            case UriPartial.Path:
            {
                StringBuilder stringBuilder2 = new StringBuilder();
                stringBuilder2.Append(this.scheme);
                stringBuilder2.Append(this.GetOpaqueWiseSchemeDelimiter());
                if (this.path.Length > 1 && this.path[1] == ':' && Uri.UriSchemeFile == this.scheme)
                {
                    stringBuilder2.Append('/');
                }
                if (this.userinfo.Length > 0)
                {
                    stringBuilder2.Append(this.userinfo).Append('@');
                }
                stringBuilder2.Append(this.host);
                int defaultPort = Uri.GetDefaultPort(this.scheme);
                if (this.port != -1 && this.port != defaultPort)
                {
                    stringBuilder2.Append(':').Append(this.port);
                }
                stringBuilder2.Append(this.path);
                return(stringBuilder2.ToString());
            }

            default:
                return(null);
            }
        }
Exemplo n.º 3
0
        public string GetRightPart(UriPartial uriPartial)
        {
            string leftPart  = GetLeftPart(uriPartial);
            string rightPart = AbsoluteUri.Substring(leftPart.Length);

            return(rightPart);
        }
Exemplo n.º 4
0
 public static string GetExtLeftPart(this Uri url, UriPartial p)
 {
     if (p == UriPartial.Authority)
     {
         string p1    = url.GetLeftPart(p);
         string first = HttpContext.Current.Items["url_first_section"] as string;
         if (string.IsNullOrWhiteSpace(first) == false)
         {
             p1 = p1 + "/" + first;
         }
         return(p1);
     }
     else if (p == UriPartial.Path)
     {
         string p1 = url.GetAbsolutePath();
         return(string.Format("{0}://{1}{2}", url.Scheme, url.Authority, p1));
     }
     else if (p == UriPartial.Query)
     {
         return(url.GetAbsoluteUri());
     }
     else
     {
         return(url.GetLeftPart(p));
     }
 }
Exemplo n.º 5
0
        internal static string GetLeftPart(string url, UriPartial part)
        {
            Uri uri = new Uri(url, UriKind.RelativeOrAbsolute);

            if (uri.IsAbsoluteUri)
            {
                return(uri.GetLeftPart(part));
            }
            switch (part)
            {
            case UriPartial.Scheme:
            case UriPartial.Authority:
                throw new InvalidOperationException();

            case UriPartial.Path:
            {
                int num = url.IndexOf('?');
                if (num < 0)
                {
                    return(url);
                }
                return(url.Substring(0, num));
            }

            default:
                return(url);
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Gets the left part of the specified URI, inclusive of the specified Uri Partial.
        /// </summary>
        /// <param name="uri">The URI.</param>
        /// <param name="part">The part.</param>
        /// <returns></returns>
        public static string GetLeftPart(this Uri uri, UriPartial part)
        {
            int defaultPort;

            switch (part)
            {
            case UriPartial.Scheme:
                return(uri.Scheme + GetOpaqueWiseSchemeDelimiter(uri.Scheme));

            case UriPartial.Authority:
                if (uri.Host == string.Empty ||
                    uri.Scheme == UriSchemeMailto ||
                    uri.Scheme == UriSchemeNews)
                {
                    return(string.Empty);
                }

                var s = new StringBuilder();
                s.Append(uri.Scheme);
                s.Append(GetOpaqueWiseSchemeDelimiter(uri.Scheme));
                if (uri.AbsolutePath.Length > 1 && uri.AbsolutePath[1] == ':' && (UriSchemeFile == uri.Scheme))
                {
                    s.Append('/');      // win32 file
                }
                if (uri.UserInfo.Length > 0)
                {
                    s.Append(uri.UserInfo).Append('@');
                }
                s.Append(uri.Host);
                defaultPort = GetDefaultPort(uri.Scheme);
                if ((uri.Port != -1) && (uri.Port != defaultPort))
                {
                    s.Append(':').Append(uri.Port);
                }
                return(s.ToString());

            case UriPartial.Path:
                var sb = new StringBuilder();
                sb.Append(uri.Scheme);
                sb.Append(GetOpaqueWiseSchemeDelimiter(uri.Scheme));
                if (uri.AbsolutePath.Length > 1 && uri.AbsolutePath[1] == ':' && (UriSchemeFile == uri.Scheme))
                {
                    sb.Append('/');      // win32 file
                }
                if (uri.UserInfo.Length > 0)
                {
                    sb.Append(uri.UserInfo).Append('@');
                }
                sb.Append(uri.Host);
                defaultPort = GetDefaultPort(uri.Scheme);
                if ((uri.Port != -1) && (uri.Port != defaultPort))
                {
                    sb.Append(':').Append(uri.Port);
                }
                sb.Append(uri.AbsolutePath);
                return(sb.ToString());
            }
            return(null);
        }
Exemplo n.º 7
0
        public string GetLeftPart(UriPartial part)
        {
            int defaultPort;

            switch (part)
            {
            case UriPartial.Scheme:
                return(scheme + GetOpaqueWiseSchemeDelimiter());

            case UriPartial.Authority:
                if (host == String.Empty ||
                    scheme == Uri.UriSchemeMailto ||
                    scheme == Uri.UriSchemeNews)
                {
                    return(String.Empty);
                }

                StringBuilder s = new StringBuilder();
                s.Append(scheme);
                s.Append(GetOpaqueWiseSchemeDelimiter());
                if (path.Length > 1 && path [1] == ':' && (Uri.UriSchemeFile == scheme))
                {
                    s.Append('/');                       // win32 file
                }
                if (userinfo.Length > 0)
                {
                    s.Append(userinfo).Append('@');
                }
                s.Append(host);
                defaultPort = GetDefaultPort(scheme);
                if ((port != -1) && (port != defaultPort))
                {
                    s.Append(':').Append(port);
                }
                return(s.ToString());

            case UriPartial.Path:
                StringBuilder sb = new StringBuilder();
                sb.Append(scheme);
                sb.Append(GetOpaqueWiseSchemeDelimiter());
                if (path.Length > 1 && path [1] == ':' && (Uri.UriSchemeFile == scheme))
                {
                    sb.Append('/');                       // win32 file
                }
                if (userinfo.Length > 0)
                {
                    sb.Append(userinfo).Append('@');
                }
                sb.Append(host);
                defaultPort = GetDefaultPort(scheme);
                if ((port != -1) && (port != defaultPort))
                {
                    sb.Append(':').Append(port);
                }
                sb.Append(path);
                return(sb.ToString());
            }
            return(null);
        }
Exemplo n.º 8
0
        protected internal virtual string GetRelativeLeftPart(UriPartial part)
        {
            if (part is UriPartial.Authority or UriPartial.Scheme)
            {
                return(null);
            }

            return(this.GetRelativeResult(this.InternalAbsoluteUri.GetLeftPart(part)));
        }
Exemplo n.º 9
0
 public static string GetLeftPart(this Uri uri, UriPartial partial)
 {
     if (partial == UriPartial.Authority)
     {
         return(uri.Scheme + uri.Host + uri.Port);
     }
     else
     {
         return(null);
     }
 }
        private void initializeDictionaries()
        {
            // It is generally easier to work with a well defined data structure than it is to work with a string with multiple delimiters. For future functionality converting the
            // metadata mappings to a data structure may be best
            // If the dictionary is not null, then there is no need to initialize it.
            if (productMetadataMapping == null)
            {
                productMetadataMapping = Context.Settings["inRiverProductMetadataMapping"].Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries)
                                         .Select(UriPartial => UriPartial.Split(':'))
                                         .ToDictionary(split => split[0], split => split[1]);
            }

            // Add new dictionary metadata mappings here.
        }
Exemplo n.º 11
0
        /// <summary>
        ///     The browser's loaded Url's given left part should meet the given condition.
        /// </summary>
        /// <param name="uriPartial">
        ///     <inheritdoc cref="Uri.GetLeftPart(UriPartial)" />
        /// </param>
        /// <param name="condition">The <see cref="Func{T,TResult}" />, that defines the condition until the browser must wait.</param>
        /// <exception cref="InvalidEnumArgumentException"></exception>
        /// <exception cref="ArgumentNullException"></exception>
        /// <exception cref="InvalidOperationException"></exception>
        /// <exception cref="ArgumentException"></exception>
        public static Func <IWebDriver, TResult> UrlLeftPart <TResult>(
            UriPartial uriPartial,
            [NotNull] Func <string, TResult> condition)
        {
            if (condition == null)
            {
                throw new ArgumentNullException(nameof(condition));
            }

            if (!Enum.IsDefined(typeof(UriPartial), uriPartial))
            {
                throw new InvalidEnumArgumentException(nameof(uriPartial), (int)uriPartial, typeof(UriPartial));
            }

            return(driver => condition(driver.Url().GetLeftPart(uriPartial)));
        }
Exemplo n.º 12
0
        //private static bool NotAny(Flags flags)
        //{
        //    return (_flags & flags) == 0;
        //}

        public static string GetLeftPart(this Uri uri, UriPartial part)
        {
            if (!uri.IsAbsoluteUri)
            {
                throw new InvalidOperationException("The URI must be absolute.");
            }

            // EnsureUriInfo();
            const UriComponents NonPathPart = (UriComponents.Scheme | UriComponents.UserInfo | UriComponents.Host | UriComponents.Port);

            switch (part)
            {
                case UriPartial.Scheme:

                    return uri.GetParts(UriComponents.Scheme | UriComponents.KeepDelimiter, UriFormat.UriEscaped);

                case UriPartial.Authority:

                    //if (NotAny(uri.Flags.AuthorityFound) || IsDosPath)
                    //{
                    //    // V1.0 compatibility.
                    //    // It not return an empty string but instead "scheme:" because it is a LEFT part.
                    //    // Also neither it should check for IsDosPath here

                    //    // From V1.0 comments:

                    //    // anything that didn't have "//" after the scheme name
                    //    // (mailto: and news: e.g.) doesn't have an authority
                    //    //

                    //    return string.Empty;
                    //}
                    return uri.GetParts(NonPathPart, UriFormat.UriEscaped);

                case UriPartial.Path:
                    return uri.GetParts(NonPathPart | UriComponents.Path, UriFormat.UriEscaped);

                case UriPartial.Query:
                    return uri.GetParts(NonPathPart | UriComponents.Path | UriComponents.Query, UriFormat.UriEscaped);
            }
            throw new ArgumentException("part");
        }
Exemplo n.º 13
0
        //private static bool NotAny(Flags flags)
        //{
        //    return (_flags & flags) == 0;
        //}

        public static string GetLeftPart(this Uri uri, UriPartial part)
        {
            if (!uri.IsAbsoluteUri)
            {
                throw new InvalidOperationException("The URI must be absolute.");
            }

            // EnsureUriInfo();
            const UriComponents NonPathPart = (UriComponents.Scheme | UriComponents.UserInfo | UriComponents.Host | UriComponents.Port);

            switch (part)
            {
            case UriPartial.Scheme:

                return(uri.GetParts(UriComponents.Scheme | UriComponents.KeepDelimiter, UriFormat.UriEscaped));

            case UriPartial.Authority:

                //if (NotAny(uri.Flags.AuthorityFound) || IsDosPath)
                //{
                //    // V1.0 compatibility.
                //    // It not return an empty string but instead "scheme:" because it is a LEFT part.
                //    // Also neither it should check for IsDosPath here

                //    // From V1.0 comments:

                //    // anything that didn't have "//" after the scheme name
                //    // (mailto: and news: e.g.) doesn't have an authority
                //    //

                //    return string.Empty;
                //}
                return(uri.GetParts(NonPathPart, UriFormat.UriEscaped));

            case UriPartial.Path:
                return(uri.GetParts(NonPathPart | UriComponents.Path, UriFormat.UriEscaped));

            case UriPartial.Query:
                return(uri.GetParts(NonPathPart | UriComponents.Path | UriComponents.Query, UriFormat.UriEscaped));
            }
            throw new ArgumentException("part");
        }
Exemplo n.º 14
0
        /// <summary>
        ///     Waits, until the browser's loaded Url should not contain the given value.
        /// </summary>
        /// <param name="wait">The <see cref="WebDriverWait" /> instance, that is used to command the browser for wait.</param>
        /// <param name="uriPartial">
        ///     <inheritdoc cref="Uri.GetLeftPart(UriPartial)" />
        /// </param>
        /// <param name="condition">The <see cref="Func{T,TResult}" />, that defines the condition until the browser must wait.</param>
        /// <exception cref="WebDriverTimeoutException"></exception>
        public static TResult UntilUrlLeftPart <TResult>(
            [NotNull] this WebDriverWait wait,
            UriPartial uriPartial,
            [NotNull] Func <string, TResult> condition)
        {
            if (wait == null)
            {
                throw new ArgumentNullException(nameof(wait));
            }
            if (condition == null)
            {
                throw new ArgumentNullException(nameof(condition));
            }

            wait.Message += " Waited for " +
                            "loaded url's left part " +
                            "to meet the given condition.";

            return(wait.Until(WebDriverWaitConditions.UrlLeftPart(uriPartial, condition)));
        }
Exemplo n.º 15
0
Arquivo: Uri.cs Projeto: ForNeVeR/pnet
        public String GetLeftPart(UriPartial part)
        {
            switch (part)
            {
            case UriPartial.Path:
                return(String.Concat(this.scheme, this.delim,
                                     this.Authority, this.path));

            case UriPartial.Authority:
                return(String.Concat(this.scheme,
                                     this.delim,
                                     this.Authority));

            case UriPartial.Scheme:
                return(String.Concat(this.scheme,
                                     this.delim));

            default:
                throw new ArgumentException(S._("Arg_UriPartial"));
            }
        }
Exemplo n.º 16
0
    public string GetLeftPart(UriPartial part)
    {
      Contract.Ensures(Contract.Result<string>() != null);

      return default(string);
    }
        public string GetLeftPart(UriPartial part)
        {
            if (this.IsNotAbsoluteUri)
            {
                throw new InvalidOperationException(System.SR.GetString("net_uri_NotAbsolute"));
            }
            this.EnsureUriInfo();
            switch (part)
            {
                case UriPartial.Scheme:
                    return this.GetParts(UriComponents.KeepDelimiter | UriComponents.Scheme, UriFormat.UriEscaped);

                case UriPartial.Authority:
                    if (!this.NotAny(Flags.AuthorityFound) && !this.IsDosPath)
                    {
                        return this.GetParts(UriComponents.SchemeAndServer | UriComponents.UserInfo, UriFormat.UriEscaped);
                    }
                    return string.Empty;

                case UriPartial.Path:
                    return this.GetParts(UriComponents.Path | UriComponents.SchemeAndServer | UriComponents.UserInfo, UriFormat.UriEscaped);

                case UriPartial.Query:
                    return this.GetParts(UriComponents.HttpRequestUrl | UriComponents.UserInfo, UriFormat.UriEscaped);
            }
            throw new ArgumentException("part");
        }
Exemplo n.º 18
0
        /// <summary>
        /// Gets the left part of the specified URI, inclusive of the specified Uri Partial.
        /// </summary>
        /// <param name="uri">The URI.</param>
        /// <param name="part">The part.</param>
        /// <returns></returns>
        public static string GetLeftPart(this Uri uri, UriPartial part)
        {
            int defaultPort;
            switch (part)
            {
                case UriPartial.Scheme:
                    return uri.Scheme + GetOpaqueWiseSchemeDelimiter(uri.Scheme);
                case UriPartial.Authority:
                    if (uri.Host == string.Empty ||
                        uri.Scheme == UriSchemeMailto ||
                        uri.Scheme == UriSchemeNews)
                        return string.Empty;

                    var s = new StringBuilder();
                    s.Append(uri.Scheme);
                    s.Append(GetOpaqueWiseSchemeDelimiter(uri.Scheme));
                    if (uri.AbsolutePath.Length > 1 && uri.AbsolutePath[1] == ':' && (UriSchemeFile == uri.Scheme))
                        s.Append('/');  // win32 file
                    if (uri.UserInfo.Length > 0)
                        s.Append(uri.UserInfo).Append('@');
                    s.Append(uri.Host);
                    defaultPort = GetDefaultPort(uri.Scheme);
                    if ((uri.Port != -1) && (uri.Port != defaultPort))
                        s.Append(':').Append(uri.Port);
                    return s.ToString();
                case UriPartial.Path:
                    var sb = new StringBuilder();
                    sb.Append(uri.Scheme);
                    sb.Append(GetOpaqueWiseSchemeDelimiter(uri.Scheme));
                    if (uri.AbsolutePath.Length > 1 && uri.AbsolutePath[1] == ':' && (UriSchemeFile == uri.Scheme))
                        sb.Append('/');  // win32 file
                    if (uri.UserInfo.Length > 0)
                        sb.Append(uri.UserInfo).Append('@');
                    sb.Append(uri.Host);
                    defaultPort = GetDefaultPort(uri.Scheme);
                    if ((uri.Port != -1) && (uri.Port != defaultPort))
                        sb.Append(':').Append(uri.Port);
                    sb.Append(uri.AbsolutePath);
                    return sb.ToString();
            }
            return null;
        }
Exemplo n.º 19
0
 //
 // Summary:
 //     Gets the specified portion of a System.Uri instance.
 //
 // Parameters:
 //   part:
 //     One of the System.UriPartial values that specifies the end of the URI portion
 //     to return.
 //
 // Returns:
 //     A System.String that contains the specified portion of the System.Uri instance.
 //
 // Exceptions:
 //   System.InvalidOperationException:
 //     The current System.Uri instance is not an absolute instance.
 //
 //   System.ArgumentException:
 //     The specified part is not valid.
 public string GetLeftPart(UriPartial part)
 {
     return _value.GetLeftPart(part);
 }
Exemplo n.º 20
0
 public string GetRightPart(UriPartial uriPartial)
 {
     string leftPart = GetLeftPart (uriPartial);
     string rightPart = AbsoluteUri.Substring (leftPart.Length);
     return rightPart;
 }
Exemplo n.º 21
0
		public string GetLeftPart (UriPartial part) 
		{
			EnsureAbsoluteUri ();
			int defaultPort;
			switch (part) {				
			case UriPartial.Scheme : 
				return scheme + GetOpaqueWiseSchemeDelimiter ();
			case UriPartial.Authority :
				if ((scheme == Uri.UriSchemeMailto) || (scheme == Uri.UriSchemeNews))
					return String.Empty;
					
				StringBuilder s = new StringBuilder ();
				s.Append (scheme);
				s.Append (GetOpaqueWiseSchemeDelimiter ());
				if (path.Length > 1 && path [1] == ':' && (Uri.UriSchemeFile == scheme)) 
					s.Append ('/');  // win32 file
				if (userinfo != null) 
					s.Append (userinfo).Append ('@');
				s.Append (host);
				defaultPort = GetDefaultPort (scheme);
				if ((port != -1) && (port != defaultPort))
					s.Append (':').Append (port);			 
				return s.ToString ();				
			case UriPartial.Path :
				StringBuilder sb = new StringBuilder ();
				sb.Append (scheme);
				sb.Append (GetOpaqueWiseSchemeDelimiter ());
				if (path.Length > 1 && path [1] == ':' && (Uri.UriSchemeFile == scheme)) 
					sb.Append ('/');  // win32 file
				if (userinfo != null) 
					sb.Append (userinfo).Append ('@');
				sb.Append (host);
				defaultPort = GetDefaultPort (scheme);
				if ((port != -1) && (port != defaultPort))
					sb.Append (':').Append (port);

				if (path.Length > 0) {
					if (scheme == "mailto" || scheme == "news")
						sb.Append (path);
					else 
						sb.Append (Reduce (path, CompactEscaped (scheme)));
				}
				return sb.ToString ();
			}
			return null;
		}
Exemplo n.º 22
0
Arquivo: Uri.cs Projeto: shmao/corefx
        //
        // GetLeftPart
        //
        //  Returns part of the URI based on the parameters:
        //
        // Inputs:
        //  <argument>  part
        //      Which part of the URI to return
        //
        // Returns:
        //  The requested substring
        //
        // Throws:
        //  UriFormatException if URI type doesn't have host-port or authority parts
        //
        public string GetLeftPart(UriPartial part)
        {
            if (IsNotAbsoluteUri)
            {
                throw new InvalidOperationException(SR.net_uri_NotAbsolute);
            }

            EnsureUriInfo();
            const UriComponents NonPathPart = (UriComponents.Scheme | UriComponents.UserInfo | UriComponents.Host | UriComponents.Port);

            switch (part)
            {
                case UriPartial.Scheme:

                    return GetParts(UriComponents.Scheme | UriComponents.KeepDelimiter, UriFormat.UriEscaped);

                case UriPartial.Authority:

                    if (NotAny(Flags.AuthorityFound) || IsDosPath)
                    {
                        // V1.0 compatibility.
                        // It not return an empty string but instead "scheme:" because it is a LEFT part.
                        // Also neither it should check for IsDosPath here

                        // From V1.0 comments:

                        // anything that didn't have "//" after the scheme name
                        // (mailto: and news: e.g.) doesn't have an authority
                        //

                        return string.Empty;
                    }
                    return GetParts(NonPathPart, UriFormat.UriEscaped);

                case UriPartial.Path:
                    return GetParts(NonPathPart | UriComponents.Path, UriFormat.UriEscaped);

                case UriPartial.Query:
                    return GetParts(NonPathPart | UriComponents.Path | UriComponents.Query, UriFormat.UriEscaped);
            }
            throw new ArgumentException(SR.Format(SR.Argument_InvalidUriSubcomponent, part), nameof(part));
        }
Exemplo n.º 23
0
 public string GetLeftPart(UriPartial part) => Inner.GetLeftPart((System.UriPartial)part);
Exemplo n.º 24
0
 public string GetLeftPart(UriPartial part)
 {
   return default(string);
 }
Exemplo n.º 25
0
 public virtual string GetLeftPart(UriPartial part)
 {
     return(this.IsAbsolute ? this.WrappedInstance.GetLeftPart(part) : this.GetRelativeLeftPart(part));
 }
Exemplo n.º 26
0
		public string GetLeftPart (UriPartial part) 
		{
			int defaultPort;
			switch (part) {				
			case UriPartial.Scheme : 
				return scheme + GetOpaqueWiseSchemeDelimiter ();
			case UriPartial.Authority :
				if (host == String.Empty ||
				    scheme == Uri.UriSchemeMailto ||
				    scheme == Uri.UriSchemeNews)
					return String.Empty;
					
				StringBuilder s = new StringBuilder ();
				s.Append (scheme);
				s.Append (GetOpaqueWiseSchemeDelimiter ());
				if (path.Length > 1 && path [1] == ':' && (Uri.UriSchemeFile == scheme)) 
					s.Append ('/');  // win32 file
				if (userinfo.Length > 0) 
					s.Append (userinfo).Append ('@');
				s.Append (host);
				defaultPort = GetDefaultPort (scheme);
				if ((port != -1) && (port != defaultPort))
					s.Append (':').Append (port);			 
				return s.ToString ();				
			case UriPartial.Path :			
				StringBuilder sb = new StringBuilder ();
				sb.Append (scheme);
				sb.Append (GetOpaqueWiseSchemeDelimiter ());
				if (path.Length > 1 && path [1] == ':' && (Uri.UriSchemeFile == scheme)) 
					sb.Append ('/');  // win32 file
				if (userinfo.Length > 0) 
					sb.Append (userinfo).Append ('@');
				sb.Append (host);
				defaultPort = GetDefaultPort (scheme);
				if ((port != -1) && (port != defaultPort))
					sb.Append (':').Append (port);			 
				sb.Append (path);
				return sb.ToString ();
			}
			return null;
		}
Exemplo n.º 27
0
		public string GetLeftPart(UriPartial part)
		{
		}
Exemplo n.º 28
0
	public String GetLeftPart(UriPartial part)
	{
		switch (part)
		{
		case UriPartial.Path:
			return String.Concat(this.scheme , this.delim, 
								this.Authority, this.path);
		case UriPartial.Authority:
			return String.Concat(this.scheme,
					     this.delim,
					     this.Authority);
		case UriPartial.Scheme:
			return String.Concat(this.scheme,
					     this.delim);
		default:
			throw new ArgumentException(S._("Arg_UriPartial"));
		}
	}
Exemplo n.º 29
0
 public string GetLeftPart(UriPartial part)
 {
 }
Exemplo n.º 30
0
        public string GetLeftPart(UriPartial part)
        {
            Contract.Ensures(Contract.Result <string>() != null);

            return(default(string));
        }
Exemplo n.º 31
0
 public string GetLeftPart(UriPartial part)
 {
     return(default(string));
 }
Exemplo n.º 32
0
        //
        // GetLeftPart
        //
        //  Returns part of the URI based on the parameters:
        //
        // Inputs:
        //  <argument>  part
        //      Which part of the URI to return
        //
        // Outputs:
        //  Nothing
        //
        // Assumes:
        //  Nothing
        //
        // Returns:
        //  The requested substring
        //
        // Throws:
        //  UriFormatException if URI type doesn't have host-port or authority parts
        //

        /// <include file='doc\URI.uex' path='docs/doc[@for="Uri.GetLeftPart"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public string GetLeftPart(UriPartial part) {
            switch (part) {
                case UriPartial.Scheme:

                    string result = m_Scheme + (m_HasSlashes ? SchemeDelimiter : ":");

                    if (m_IsFileReally && !m_IsUnc) {
                        result += "/";
                    }
                    return result;

                case UriPartial.Authority:
                    if (!m_HasSlashes || (m_IsFileReally && !m_IsUnc)) {

                        //
                        // anything that didn't have "//" after the scheme name
                        // (mailto: and news: e.g.) doesn't have an authority
                        //

                        return String.Empty;
                    }
                    return NonPathPart;

                case UriPartial.Path:
                    return NonPathPart + m_Path;
            }
            throw new ArgumentException("part");
        }
Exemplo n.º 33
0
 public string GetLeftPart(UriPartial part)
 {
     throw new NotImplementedException();
 }