private void Write107_VirtualItemNameListFilter(string n, string ns, VirtualItemNameListFilter o, bool isNullable, bool needType) { if (o == null) { if (isNullable) { base.WriteNullTagLiteral(n, ns); } } else { if (!needType && (o.GetType() != typeof(VirtualItemNameListFilter))) { throw base.CreateUnknownTypeException(o); } base.WriteStartElement(n, ns, o, false, null); if (needType) { base.WriteXsiType("VirtualItemNameListFilter", ""); } base.WriteElementString("Condition", "", this.Write106_NameListCondition(o.Condition)); string[] names = o.Names; if (names != null) { base.WriteStartElement("Names", "", null, false); for (int i = 0; i < names.Length; i++) { base.WriteNullableStringLiteral("string", "", names[i]); } base.WriteEndElement(); } base.WriteEndElement(o); } }
private VirtualItemNameListFilter Read107_VirtualItemNameListFilter(bool isNullable, bool checkType) { XmlQualifiedName type = checkType ? base.GetXsiType() : null; bool flag = false; if (isNullable) { flag = base.ReadNull(); } if ((checkType && (type != null)) && ((type.Name != this.id69_VirtualItemNameListFilter) || (type.Namespace != this.id2_Item))) { throw base.CreateUnknownTypeException(type); } if (flag) { return null; } VirtualItemNameListFilter o = new VirtualItemNameListFilter(); bool[] flagArray = new bool[2]; while (base.Reader.MoveToNextAttribute()) { if (!base.IsXmlnsAttribute(base.Reader.Name)) { base.UnknownNode(o); } } base.Reader.MoveToElement(); if (base.Reader.IsEmptyElement) { base.Reader.Skip(); return o; } base.Reader.ReadStartElement(); base.Reader.MoveToContent(); int whileIterations = 0; int readerCount = base.ReaderCount; while ((base.Reader.NodeType != XmlNodeType.EndElement) && (base.Reader.NodeType != XmlNodeType.None)) { if (base.Reader.NodeType == XmlNodeType.Element) { if ((!flagArray[0] && (base.Reader.LocalName == this.id209_Condition)) && (base.Reader.NamespaceURI == this.id2_Item)) { o.Condition = this.Read106_NameListCondition(base.Reader.ReadElementString()); flagArray[0] = true; } else if ((base.Reader.LocalName == this.id210_Names) && (base.Reader.NamespaceURI == this.id2_Item)) { if (!base.ReadNull()) { string[] a = null; int index = 0; if (base.Reader.IsEmptyElement) { base.Reader.Skip(); } else { base.Reader.ReadStartElement(); base.Reader.MoveToContent(); int num4 = 0; int num5 = base.ReaderCount; while ((base.Reader.NodeType != XmlNodeType.EndElement) && (base.Reader.NodeType != XmlNodeType.None)) { if (base.Reader.NodeType == XmlNodeType.Element) { if ((base.Reader.LocalName == this.id211_string) && (base.Reader.NamespaceURI == this.id2_Item)) { if (base.ReadNull()) { a = (string[]) base.EnsureArrayIndex(a, index, typeof(string)); a[index++] = null; } else { a = (string[]) base.EnsureArrayIndex(a, index, typeof(string)); a[index++] = base.Reader.ReadElementString(); } } else { base.UnknownNode(null, ":string"); } } else { base.UnknownNode(null, ":string"); } base.Reader.MoveToContent(); base.CheckReaderCount(ref num4, ref num5); } base.ReadEndElement(); } o.Names = (string[]) base.ShrinkArray(a, index, typeof(string), false); } } else { base.UnknownNode(o, ":Condition, :Names"); } } else { base.UnknownNode(o, ":Condition, :Names"); } base.Reader.MoveToContent(); base.CheckReaderCount(ref whileIterations, ref readerCount); } base.ReadEndElement(); return o; }