private void Write204_CopyProgressSnapshot(string n, string ns, CopyProgressSnapshot o, bool isNullable, bool needType) { if (o == null) { if (isNullable) { base.WriteNullTagLiteral(n, ns); } } else { if (!needType && (o.GetType() != typeof(CopyProgressSnapshot))) { throw base.CreateUnknownTypeException(o); } base.WriteStartElement(n, ns, o, false, null); if (needType) { base.WriteXsiType("CopyProgressSnapshot", ""); } this.Write185_ProcessedSize("Processed", "", o.Processed, false); base.WriteElementStringRaw("TotalCount", "", XmlConvert.ToString(o.TotalCount)); base.WriteElementStringRaw("ProcessedCount", "", XmlConvert.ToString(o.ProcessedCount)); base.WriteElementStringRaw("SkippedCount", "", XmlConvert.ToString(o.SkippedCount)); this.Write186_TimeSpan("Duration", "", o.Duration, false); base.WriteElementString("CopyMode", "", this.Write203_CopyMode(o.CopyMode)); base.WriteEndElement(o); } }
public CopyProgressSnapshot GetProgressSnapshot() { CopyProgressSnapshot snapshot = new CopyProgressSnapshot(); lock (this.FSnapshotLock) { snapshot.Processed = this.FTotalProcessed; snapshot.TotalCount = this.FTotalCount; snapshot.ProcessedCount = this.FProcessedCount; snapshot.SkippedCount = this.FSkippedCount; snapshot.CopyMode = this.FCopyMode; } snapshot.Duration = base.Duration; return snapshot; }
private CopyProgressSnapshot Read204_CopyProgressSnapshot(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.id160_CopyProgressSnapshot) || (type.Namespace != this.id2_Item))) { throw base.CreateUnknownTypeException(type); } if (flag) { return null; } CopyProgressSnapshot o = new CopyProgressSnapshot(); 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.id165_SkippedCount)) && (base.Reader.NamespaceURI == this.id2_Item)) { o.SkippedCount = XmlConvert.ToInt32(base.Reader.ReadElementString()); flagArray[3] = true; } else if ((!flagArray[4] && (base.Reader.LocalName == this.id166_Duration)) && (base.Reader.NamespaceURI == this.id2_Item)) { o.Duration = this.Read186_TimeSpan(true); flagArray[4] = true; } else if ((!flagArray[5] && (base.Reader.LocalName == this.id158_CopyMode)) && (base.Reader.NamespaceURI == this.id2_Item)) { o.CopyMode = this.Read203_CopyMode(base.Reader.ReadElementString()); flagArray[5] = true; } else { base.UnknownNode(o, ":Processed, :TotalCount, :ProcessedCount, :SkippedCount, :Duration, :CopyMode"); } } else { base.UnknownNode(o, ":Processed, :TotalCount, :ProcessedCount, :SkippedCount, :Duration, :CopyMode"); } base.Reader.MoveToContent(); base.CheckReaderCount(ref whileIterations, ref readerCount); } base.ReadEndElement(); return o; }