private void Write12_TimePointScaningSettings(string n, string ns, TimePointScaningSettings o, bool isNullable, bool needType) { if (o == null) { if (isNullable) { base.WriteNullTagLiteral(n, ns); } return; } if (!needType) { Type type = o.GetType(); if (!(type == typeof(TimePointScaningSettings))) { throw base.CreateUnknownTypeException(o); } } base.WriteStartElement(n, ns, o, false, null); if (needType) { base.WriteXsiType("TimePointScaningSettings", ""); } base.WriteElementStringRaw("Enabled", "", XmlConvert.ToString(o.Enabled)); base.WriteElementStringRaw("NotifyingTimeInDay", "", XmlSerializationWriter.FromDateTime(o.NotifyingTimeInDay)); this.Write6_Duration("Duration", "", o.Duration, false, false); this.Write11_Recurrence("Recurrence", "", o.Recurrence, false, false); base.WriteEndElement(o); }
private TimePointScaningSettings Read12_TimePointScaningSettings(bool isNullable, bool checkType) { XmlQualifiedName xmlQualifiedName = checkType ? base.GetXsiType() : null; bool flag = false; if (isNullable) { flag = base.ReadNull(); } if (checkType && !(xmlQualifiedName == null) && (xmlQualifiedName.Name != this.id13_TimePointScaningSettings || xmlQualifiedName.Namespace != this.id2_Item)) { throw base.CreateUnknownTypeException(xmlQualifiedName); } if (flag) { return(null); } TimePointScaningSettings timePointScaningSettings = new TimePointScaningSettings(); bool[] array = new bool[4]; while (base.Reader.MoveToNextAttribute()) { if (!base.IsXmlnsAttribute(base.Reader.Name)) { base.UnknownNode(timePointScaningSettings); } } base.Reader.MoveToElement(); if (base.Reader.IsEmptyElement) { base.Reader.Skip(); return(timePointScaningSettings); } base.Reader.ReadStartElement(); base.Reader.MoveToContent(); int num = 0; int readerCount = base.ReaderCount; while (base.Reader.NodeType != XmlNodeType.EndElement && base.Reader.NodeType != XmlNodeType.None) { if (base.Reader.NodeType == XmlNodeType.Element) { if (!array[0] && base.Reader.LocalName == this.id14_Enabled && base.Reader.NamespaceURI == this.id2_Item) { timePointScaningSettings.Enabled = XmlConvert.ToBoolean(base.Reader.ReadElementString()); array[0] = true; } else if (!array[1] && base.Reader.LocalName == this.id15_NotifyingTimeInDay && base.Reader.NamespaceURI == this.id2_Item) { timePointScaningSettings.NotifyingTimeInDay = XmlSerializationReader.ToDateTime(base.Reader.ReadElementString()); array[1] = true; } else if (!array[2] && base.Reader.LocalName == this.id16_Duration && base.Reader.NamespaceURI == this.id2_Item) { timePointScaningSettings.Duration = this.Read6_Duration(false, true); array[2] = true; } else if (!array[3] && base.Reader.LocalName == this.id17_Recurrence && base.Reader.NamespaceURI == this.id2_Item) { timePointScaningSettings.Recurrence = this.Read11_Recurrence(false, true); array[3] = true; } else { base.UnknownNode(timePointScaningSettings, ":Enabled, :NotifyingTimeInDay, :Duration, :Recurrence"); } } else { base.UnknownNode(timePointScaningSettings, ":Enabled, :NotifyingTimeInDay, :Duration, :Recurrence"); } base.Reader.MoveToContent(); base.CheckReaderCount(ref num, ref readerCount); } base.ReadEndElement(); return(timePointScaningSettings); }