Example #1
0
 private void Write7_TimeSlotMonitoringSettings(string n, string ns, TimeSlotMonitoringSettings o, bool isNullable, bool needType)
 {
     if (o == null)
     {
         if (isNullable)
         {
             base.WriteNullTagLiteral(n, ns);
         }
         return;
     }
     if (!needType)
     {
         Type type = o.GetType();
         if (!(type == typeof(TimeSlotMonitoringSettings)))
         {
             throw base.CreateUnknownTypeException(o);
         }
     }
     base.WriteStartElement(n, ns, o, false, null);
     if (needType)
     {
         base.WriteXsiType("TimeSlotMonitoringSettings", "");
     }
     base.WriteElementStringRaw("Enabled", "", XmlConvert.ToString(o.Enabled));
     base.WriteElementStringRaw("NotifyInWorkHoursTimeSlot", "", XmlConvert.ToString(o.NotifyInWorkHoursTimeSlot));
     base.WriteElementStringRaw("NotifyingStartTimeInDay", "", XmlSerializationWriter.FromDateTime(o.NotifyingStartTimeInDay));
     base.WriteElementStringRaw("NotifyingEndTimeInDay", "", XmlSerializationWriter.FromDateTime(o.NotifyingEndTimeInDay));
     this.Write6_Duration("Duration", "", o.Duration, false, false);
     base.WriteEndElement(o);
 }
Example #2
0
        private TimeSlotMonitoringSettings Read7_TimeSlotMonitoringSettings(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.id27_TimeSlotMonitoringSettings || xmlQualifiedName.Namespace != this.id2_Item))
            {
                throw base.CreateUnknownTypeException(xmlQualifiedName);
            }
            if (flag)
            {
                return(null);
            }
            TimeSlotMonitoringSettings timeSlotMonitoringSettings = new TimeSlotMonitoringSettings();

            bool[] array = new bool[5];
            while (base.Reader.MoveToNextAttribute())
            {
                if (!base.IsXmlnsAttribute(base.Reader.Name))
                {
                    base.UnknownNode(timeSlotMonitoringSettings);
                }
            }
            base.Reader.MoveToElement();
            if (base.Reader.IsEmptyElement)
            {
                base.Reader.Skip();
                return(timeSlotMonitoringSettings);
            }
            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)
                    {
                        timeSlotMonitoringSettings.Enabled = XmlConvert.ToBoolean(base.Reader.ReadElementString());
                        array[0] = true;
                    }
                    else if (!array[1] && base.Reader.LocalName == this.id28_NotifyInWorkHoursTimeSlot && base.Reader.NamespaceURI == this.id2_Item)
                    {
                        timeSlotMonitoringSettings.NotifyInWorkHoursTimeSlot = XmlConvert.ToBoolean(base.Reader.ReadElementString());
                        array[1] = true;
                    }
                    else if (!array[2] && base.Reader.LocalName == this.id29_NotifyingStartTimeInDay && base.Reader.NamespaceURI == this.id2_Item)
                    {
                        timeSlotMonitoringSettings.NotifyingStartTimeInDay = XmlSerializationReader.ToDateTime(base.Reader.ReadElementString());
                        array[2] = true;
                    }
                    else if (!array[3] && base.Reader.LocalName == this.id30_NotifyingEndTimeInDay && base.Reader.NamespaceURI == this.id2_Item)
                    {
                        timeSlotMonitoringSettings.NotifyingEndTimeInDay = XmlSerializationReader.ToDateTime(base.Reader.ReadElementString());
                        array[3] = true;
                    }
                    else if (!array[4] && base.Reader.LocalName == this.id16_Duration && base.Reader.NamespaceURI == this.id2_Item)
                    {
                        timeSlotMonitoringSettings.Duration = this.Read6_Duration(false, true);
                        array[4] = true;
                    }
                    else
                    {
                        base.UnknownNode(timeSlotMonitoringSettings, ":Enabled, :NotifyInWorkHoursTimeSlot, :NotifyingStartTimeInDay, :NotifyingEndTimeInDay, :Duration");
                    }
                }
                else
                {
                    base.UnknownNode(timeSlotMonitoringSettings, ":Enabled, :NotifyInWorkHoursTimeSlot, :NotifyingStartTimeInDay, :NotifyingEndTimeInDay, :Duration");
                }
                base.Reader.MoveToContent();
                base.CheckReaderCount(ref num, ref readerCount);
            }
            base.ReadEndElement();
            return(timeSlotMonitoringSettings);
        }