private void Write98_VirtualItemSizeFilter(string n, string ns, VirtualItemSizeFilter o, bool isNullable, bool needType) { if (o == null) { if (isNullable) { base.WriteNullTagLiteral(n, ns); } } else { if (!needType && (o.GetType() != typeof(VirtualItemSizeFilter))) { throw base.CreateUnknownTypeException(o); } base.WriteStartElement(n, ns, o, false, null); if (needType) { base.WriteXsiType("VirtualItemSizeFilter", ""); } base.WriteElementString("ValueComparision", "", this.Write73_SimpleComparision(o.ValueComparision)); base.WriteElementStringRaw("FromValue", "", XmlConvert.ToString(o.FromValue)); base.WriteElementStringRaw("ToValue", "", XmlConvert.ToString(o.ToValue)); if (o.SizeUnit != SizeUnit.Byte) { base.WriteElementString("SizeUnit", "", this.Write95_SizeUnit(o.SizeUnit)); } base.WriteElementString("SizeComparision", "", this.Write96_SizeComparision(o.SizeComparision)); base.WriteEndElement(o); } }
private VirtualItemSizeFilter Read98_VirtualItemSizeFilter(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.id62_VirtualItemSizeFilter) || (type.Namespace != this.id2_Item))) { throw base.CreateUnknownTypeException(type); } if (flag) { return null; } VirtualItemSizeFilter o = new VirtualItemSizeFilter(); bool[] flagArray = new bool[5]; 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.id200_ValueComparision)) && (base.Reader.NamespaceURI == this.id2_Item)) { o.ValueComparision = this.Read73_SimpleComparision(base.Reader.ReadElementString()); flagArray[0] = true; } else if ((!flagArray[1] && (base.Reader.LocalName == this.id201_FromValue)) && (base.Reader.NamespaceURI == this.id2_Item)) { o.FromValue = XmlConvert.ToInt64(base.Reader.ReadElementString()); flagArray[1] = true; } else if ((!flagArray[2] && (base.Reader.LocalName == this.id202_ToValue)) && (base.Reader.NamespaceURI == this.id2_Item)) { o.ToValue = XmlConvert.ToInt64(base.Reader.ReadElementString()); flagArray[2] = true; } else if ((!flagArray[3] && (base.Reader.LocalName == this.id203_SizeUnit)) && (base.Reader.NamespaceURI == this.id2_Item)) { if (base.Reader.IsEmptyElement) { base.Reader.Skip(); } else { o.SizeUnit = this.Read95_SizeUnit(base.Reader.ReadElementString()); } flagArray[3] = true; } else if ((!flagArray[4] && (base.Reader.LocalName == this.id204_SizeComparision)) && (base.Reader.NamespaceURI == this.id2_Item)) { o.SizeComparision = this.Read96_SizeComparision(base.Reader.ReadElementString()); flagArray[4] = true; } else { base.UnknownNode(o, ":ValueComparision, :FromValue, :ToValue, :SizeUnit, :SizeComparision"); } } else { base.UnknownNode(o, ":ValueComparision, :FromValue, :ToValue, :SizeUnit, :SizeComparision"); } base.Reader.MoveToContent(); base.CheckReaderCount(ref whileIterations, ref readerCount); } base.ReadEndElement(); return o; }