private void Write187_PackProgressSnapshot(string n, string ns, PackProgressSnapshot o, bool isNullable, bool needType) { if (o == null) { if (isNullable) { base.WriteNullTagLiteral(n, ns); } } else { if (!needType && (o.GetType() != typeof(PackProgressSnapshot))) { throw base.CreateUnknownTypeException(o); } base.WriteStartElement(n, ns, o, false, null); if (needType) { base.WriteXsiType("PackProgressSnapshot", ""); } this.Write185_ProcessedSize("Processed", "", o.Processed, false); base.WriteElementStringRaw("TotalCount", "", XmlConvert.ToString(o.TotalCount)); base.WriteElementStringRaw("ProcessedCount", "", XmlConvert.ToString(o.ProcessedCount)); this.Write186_TimeSpan("Duration", "", o.Duration, false); base.WriteElementStringRaw("CompressionRatio", "", XmlConvert.ToString(o.CompressionRatio)); base.WriteElementString("Stage", "", this.Write184_PackStage(o.Stage)); base.WriteEndElement(o); } }
private PackProgressSnapshot Read187_PackProgressSnapshot(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.id141_PackProgressSnapshot) || (type.Namespace != this.id2_Item))) { throw base.CreateUnknownTypeException(type); } if (flag) { return null; } PackProgressSnapshot o = new PackProgressSnapshot(); bool[] flagArray = new bool[6]; 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.id162_Processed)) && (base.Reader.NamespaceURI == this.id2_Item)) { o.Processed = this.Read185_ProcessedSize(true); flagArray[0] = true; } else if ((!flagArray[1] && (base.Reader.LocalName == this.id163_TotalCount)) && (base.Reader.NamespaceURI == this.id2_Item)) { o.TotalCount = XmlConvert.ToInt32(base.Reader.ReadElementString()); flagArray[1] = true; } else if ((!flagArray[2] && (base.Reader.LocalName == this.id164_ProcessedCount)) && (base.Reader.NamespaceURI == this.id2_Item)) { o.ProcessedCount = XmlConvert.ToInt32(base.Reader.ReadElementString()); flagArray[2] = true; } else if ((!flagArray[3] && (base.Reader.LocalName == this.id166_Duration)) && (base.Reader.NamespaceURI == this.id2_Item)) { o.Duration = this.Read186_TimeSpan(true); flagArray[3] = true; } else if ((!flagArray[4] && (base.Reader.LocalName == this.id169_CompressionRatio)) && (base.Reader.NamespaceURI == this.id2_Item)) { o.CompressionRatio = XmlConvert.ToInt32(base.Reader.ReadElementString()); flagArray[4] = true; } else if ((!flagArray[5] && (base.Reader.LocalName == this.id170_Stage)) && (base.Reader.NamespaceURI == this.id2_Item)) { o.Stage = this.Read184_PackStage(base.Reader.ReadElementString()); flagArray[5] = true; } else { base.UnknownNode(o, ":Processed, :TotalCount, :ProcessedCount, :Duration, :CompressionRatio, :Stage"); } } else { base.UnknownNode(o, ":Processed, :TotalCount, :ProcessedCount, :Duration, :CompressionRatio, :Stage"); } base.Reader.MoveToContent(); base.CheckReaderCount(ref whileIterations, ref readerCount); } base.ReadEndElement(); return o; }