UriEncode() static private method

static private UriEncode ( String value, StringBuilder sb ) : void
value String
sb StringBuilder
return void
Ejemplo n.º 1
0
        public static string CodeXmlNamespaceForClrTypeNamespace(string typeNamespace, string assemblyName)
        {
            StringBuilder stringBuilder = new StringBuilder(256);

            if (SoapServices.IsNameNull(typeNamespace))
            {
                if (SoapServices.IsNameNull(assemblyName))
                {
                    throw new ArgumentNullException("typeNamespace,assemblyName");
                }
                stringBuilder.Append(SoapServices.assemblyNS);
                SoapServices.UriEncode(assemblyName, stringBuilder);
            }
            else if (SoapServices.IsNameNull(assemblyName))
            {
                stringBuilder.Append(SoapServices.namespaceNS);
                stringBuilder.Append(typeNamespace);
            }
            else
            {
                stringBuilder.Append(SoapServices.fullNS);
                if (typeNamespace[0] == '.')
                {
                    stringBuilder.Append(typeNamespace.Substring(1));
                }
                else
                {
                    stringBuilder.Append(typeNamespace);
                }
                stringBuilder.Append('/');
                SoapServices.UriEncode(assemblyName, stringBuilder);
            }
            return(stringBuilder.ToString());
        }