Example #1
0
 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
     global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
     global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
     EMDataSet ds = new EMDataSet();
     global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
     any1.Namespace = "http://www.w3.org/2001/XMLSchema";
     any1.MinOccurs = new decimal(0);
     any1.MaxOccurs = decimal.MaxValue;
     any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any1);
     global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
     any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
     any2.MinOccurs = new decimal(1);
     any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any2);
     global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
     attribute1.Name = "namespace";
     attribute1.FixedValue = ds.Namespace;
     type.Attributes.Add(attribute1);
     global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
     attribute2.Name = "tableTypeName";
     attribute2.FixedValue = "CompanyTblDataTable";
     type.Attributes.Add(attribute2);
     type.Particle = sequence;
     global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
     if (xs.Contains(dsSchema.TargetNamespace)) {
         global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
         global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
         try {
             global::System.Xml.Schema.XmlSchema schema = null;
             dsSchema.Write(s1);
             for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
                 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                 s2.SetLength(0);
                 schema.Write(s2);
                 if ((s1.Length == s2.Length)) {
                     s1.Position = 0;
                     s2.Position = 0;
                     for (; ((s1.Position != s1.Length) 
                                 && (s1.ReadByte() == s2.ReadByte())); ) {
                         ;
                     }
                     if ((s1.Position == s1.Length)) {
                         return type;
                     }
                 }
             }
         }
         finally {
             if ((s1 != null)) {
                 s1.Close();
             }
             if ((s2 != null)) {
                 s2.Close();
             }
         }
     }
     xs.Add(dsSchema);
     return type;
 }
 global::System.Xml.Schema.XmlSchemaAttribute Read36_XmlSchemaAttribute(bool isNullable, bool checkType) {
     System.Xml.XmlQualifiedName xsiType = checkType ? GetXsiType() : null;
     bool isNull = false;
     if (isNullable) isNull = ReadNull();
     if (checkType) {
     if (xsiType == null || ((object) ((System.Xml.XmlQualifiedName)xsiType).Name == (object)id124_XmlSchemaAttribute && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id95_Item)) {
     }
     else
         throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
     }
     if (isNull) return null;
     DecodeName = false;
     global::System.Xml.Schema.XmlSchemaAttribute o;
     o = new global::System.Xml.Schema.XmlSchemaAttribute();
     global::System.Xml.XmlAttribute[] a_3 = null;
     int ca_3 = 0;
     bool[] paramsRead = new bool[12];
     while (Reader.MoveToNextAttribute()) {
         if (!paramsRead[1] && ((object) Reader.LocalName == (object)id102_id && (object) Reader.NamespaceURI == (object)id5_Item)) {
             o.@Id = CollapseWhitespace(Reader.Value);
             paramsRead[1] = true;
         }
         else if (!paramsRead[4] && ((object) Reader.LocalName == (object)id125_default && (object) Reader.NamespaceURI == (object)id5_Item)) {
             o.@DefaultValue = Reader.Value;
             paramsRead[4] = true;
         }
         else if (!paramsRead[5] && ((object) Reader.LocalName == (object)id126_fixed && (object) Reader.NamespaceURI == (object)id5_Item)) {
             o.@FixedValue = Reader.Value;
             paramsRead[5] = true;
         }
         else if (!paramsRead[6] && ((object) Reader.LocalName == (object)id127_form && (object) Reader.NamespaceURI == (object)id5_Item)) {
             o.@Form = Read6_XmlSchemaForm(Reader.Value);
             paramsRead[6] = true;
         }
         else if (!paramsRead[7] && ((object) Reader.LocalName == (object)id4_name && (object) Reader.NamespaceURI == (object)id5_Item)) {
             o.@Name = Reader.Value;
             paramsRead[7] = true;
         }
         else if (!paramsRead[8] && ((object) Reader.LocalName == (object)id123_ref && (object) Reader.NamespaceURI == (object)id5_Item)) {
             o.@RefName = ToXmlQualifiedName(Reader.Value);
             paramsRead[8] = true;
         }
         else if (!paramsRead[9] && ((object) Reader.LocalName == (object)id27_type && (object) Reader.NamespaceURI == (object)id5_Item)) {
             o.@SchemaTypeName = ToXmlQualifiedName(Reader.Value);
             paramsRead[9] = true;
         }
         else if (!paramsRead[11] && ((object) Reader.LocalName == (object)id35_use && (object) Reader.NamespaceURI == (object)id5_Item)) {
             o.@Use = Read35_XmlSchemaUse(Reader.Value);
             paramsRead[11] = true;
         }
         else if (IsXmlnsAttribute(Reader.Name)) {
             if (o.@Namespaces == null) o.@Namespaces = new global::System.Xml.Serialization.XmlSerializerNamespaces();
             ((global::System.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
         }
         else {
             System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
             ParseWsdlArrayType(attr);
             a_3 = (global::System.Xml.XmlAttribute[])EnsureArrayIndex(a_3, ca_3, typeof(global::System.Xml.XmlAttribute)); a_3[ca_3++] = attr;
         }
     }
     o.@UnhandledAttributes = (global::System.Xml.XmlAttribute[])ShrinkArray(a_3, ca_3, typeof(global::System.Xml.XmlAttribute), true);
     Reader.MoveToElement();
     if (Reader.IsEmptyElement) {
         Reader.Skip();
         o.@UnhandledAttributes = (global::System.Xml.XmlAttribute[])ShrinkArray(a_3, ca_3, typeof(global::System.Xml.XmlAttribute), true);
         return o;
     }
     Reader.ReadStartElement();
     Reader.MoveToContent();
     int whileIterations48 = 0;
     int readerCount48 = ReaderCount;
     while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None) {
         if (Reader.NodeType == System.Xml.XmlNodeType.Element) {
             if (!paramsRead[2] && ((object) Reader.LocalName == (object)id107_annotation && (object) Reader.NamespaceURI == (object)id95_Item)) {
                 o.@Annotation = Read11_XmlSchemaAnnotation(false, true);
                 paramsRead[2] = true;
             }
             else if (!paramsRead[10] && ((object) Reader.LocalName == (object)id105_simpleType && (object) Reader.NamespaceURI == (object)id95_Item)) {
                 o.@SchemaType = Read34_XmlSchemaSimpleType(false, true);
                 paramsRead[10] = true;
             }
             else {
                 UnknownNode((object)o, @"http://www.w3.org/2001/XMLSchema:annotation, http://www.w3.org/2001/XMLSchema:simpleType");
             }
         }
         else {
             UnknownNode((object)o, @"http://www.w3.org/2001/XMLSchema:annotation, http://www.w3.org/2001/XMLSchema:simpleType");
         }
         Reader.MoveToContent();
         CheckReaderCount(ref whileIterations48, ref readerCount48);
     }
     o.@UnhandledAttributes = (global::System.Xml.XmlAttribute[])ShrinkArray(a_3, ca_3, typeof(global::System.Xml.XmlAttribute), true);
     ReadEndElement();
     return o;
 }
Example #3
0
 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
     global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
     global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
     DataSet1 ds = new DataSet1();
     xs.Add(ds.GetSchemaSerializable());
     global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
     any1.Namespace = "http://www.w3.org/2001/XMLSchema";
     any1.MinOccurs = new decimal(0);
     any1.MaxOccurs = decimal.MaxValue;
     any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any1);
     global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
     any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
     any2.MinOccurs = new decimal(1);
     any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any2);
     global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
     attribute1.Name = "namespace";
     attribute1.FixedValue = ds.Namespace;
     type.Attributes.Add(attribute1);
     global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
     attribute2.Name = "tableTypeName";
     attribute2.FixedValue = "DataTable1DataTable";
     type.Attributes.Add(attribute2);
     type.Particle = sequence;
     return type;
 }
            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs)
            {
                global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
                global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
                TablaReporte ds = new TablaReporte();

                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
                any1.Namespace       = "http://www.w3.org/2001/XMLSchema";
                any1.MinOccurs       = new decimal(0);
                any1.MaxOccurs       = decimal.MaxValue;
                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any1);
                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
                any2.Namespace       = "urn:schemas-microsoft-com:xml-diffgram-v1";
                any2.MinOccurs       = new decimal(1);
                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any2);
                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute1.Name       = "namespace";
                attribute1.FixedValue = ds.Namespace;
                type.Attributes.Add(attribute1);
                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute2.Name       = "tableTypeName";
                attribute2.FixedValue = "DataTable1DataTable";
                type.Attributes.Add(attribute2);
                type.Particle = sequence;
                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
                if (xs.Contains(dsSchema.TargetNamespace))
                {
                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                    try {
                        global::System.Xml.Schema.XmlSchema schema = null;
                        dsSchema.Write(s1);
                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                        {
                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                            s2.SetLength(0);
                            schema.Write(s2);
                            if ((s1.Length == s2.Length))
                            {
                                s1.Position = 0;
                                s2.Position = 0;
                                for (; ((s1.Position != s1.Length) &&
                                        (s1.ReadByte() == s2.ReadByte()));)
                                {
                                    ;
                                }
                                if ((s1.Position == s1.Length))
                                {
                                    return(type);
                                }
                            }
                        }
                    }
                    finally {
                        if ((s1 != null))
                        {
                            s1.Close();
                        }
                        if ((s2 != null))
                        {
                            s2.Close();
                        }
                    }
                }
                xs.Add(dsSchema);
                return(type);
            }