Пример #1
0
 public XObjectsNamespaceList(string namespaces, string targetNamespace)
 {
     this.targetNamespace = targetNamespace;
     this.namespaces      = namespaces;
     if (namespaces == "##any" || namespaces.Length == 0)
     {
         type = ListType.Any;
     }
     else if (namespaces == "##other")
     {
         type = ListType.Other;
     }
     else
     {
         type = ListType.Set;
         set  = new Hashtable();
         foreach (string ns in XmlConvertExt.SplitString(namespaces))
         {
             if (ns == "##local")
             {
                 set[string.Empty] = string.Empty;
             }
             else if (ns == "##targetNamespace")
             {
                 set[targetNamespace] = targetNamespace;
             }
             else
             {
                 XmlConvertExt.ToUri(ns); // can throw
                 set[ns] = ns;
             }
         }
     }
 }
 public XObjectsNamespaceList(string namespaces, string targetNamespace)
 {
     this.targetNamespace = targetNamespace;
     this.namespaces      = namespaces;
     if (!(namespaces == "##any" ? false : namespaces.Length != 0))
     {
         this.type = XObjectsNamespaceList.ListType.Any;
     }
     else if (!(namespaces == "##other"))
     {
         this.type = XObjectsNamespaceList.ListType.Set;
         this.@set = new Hashtable();
         string[] strArrays = XmlConvertExt.SplitString(namespaces);
         for (int i = 0; i < (int)strArrays.Length; i++)
         {
             string ns = strArrays[i];
             if (ns == "##local")
             {
                 this.@set[string.Empty] = string.Empty;
             }
             else if (!(ns == "##targetNamespace"))
             {
                 XmlConvertExt.ToUri(ns);
                 this.@set[ns] = ns;
             }
             else
             {
                 this.@set[targetNamespace] = targetNamespace;
             }
         }
     }
     else
     {
         this.type = XObjectsNamespaceList.ListType.Other;
     }
 }