System.Runtime.Remoting.SoapServices.CodeXmlNamespaceForClrTypeNamespace C# (CSharp) Méthode

CodeXmlNamespaceForClrTypeNamespace() public static méthode

public static CodeXmlNamespaceForClrTypeNamespace ( String typeNamespace, String assemblyName ) : String
typeNamespace String
assemblyName String
Résultat String
        public static String CodeXmlNamespaceForClrTypeNamespace(String typeNamespace, String assemblyName)
        {
            StringBuilder sb = new StringBuilder(256);
            if (IsNameNull(typeNamespace))
            {
                if (IsNameNull(assemblyName))
                    throw new ArgumentNullException("typeNamespace"+",assemblyName");
                else
                {
                    sb.Append(assemblyNS);
                    UriEncode(assemblyName, sb);
                }
            }
            else if (IsNameNull(assemblyName))
            {
                sb.Append(namespaceNS);
                sb.Append(typeNamespace);
            }
            else
            {
                sb.Append(fullNS);
                if (typeNamespace[0] == '.')
                    sb.Append(typeNamespace.Substring(1));
                else
                    sb.Append(typeNamespace);
                sb.Append('/');
                UriEncode(assemblyName, sb);
            }
            return sb.ToString();
        }

Usage Example

Exemple #1
0
 /// <summary>Retrieves the XML namespace used during the generation of responses to the remote call to the method specified in the given <see cref="T:System.Reflection.MethodBase" />.</summary>
 /// <returns>The XML namespace used during the generation of responses to a remote method call.</returns>
 /// <param name="mb">The <see cref="T:System.Reflection.MethodBase" /> of the method for which the XML namespace was requested. </param>
 /// <exception cref="T:System.Security.SecurityException">The immediate caller does not have infrastructure permission. </exception>
 /// <PermissionSet>
 ///   <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
 /// </PermissionSet>
 public static string GetXmlNamespaceForMethodResponse(MethodBase mb)
 {
     return(SoapServices.CodeXmlNamespaceForClrTypeNamespace(mb.DeclaringType.FullName, SoapServices.GetAssemblyName(mb)));
 }