private void Write5_ReplyBodySerializer(string n, string ns, ReplyBodySerializer o, bool isNullable, bool needType) { if (o == null) { if (isNullable) { base.WriteNullTagLiteral(n, ns); } return; } if (!needType) { Type type = o.GetType(); if (!(type == typeof(ReplyBodySerializer))) { throw base.CreateUnknownTypeException(o); } } base.WriteStartElement(n, ns, o, false, null); if (needType) { base.WriteXsiType("ReplyBodySerializer", ""); } base.WriteElementString("Message", "", o.Message); base.WriteElementString("LanguageTag", "", o.LanguageTag); base.WriteEndElement(o); }
internal static UserOofSettingsSerializer Serialize(UserOofSettings userOofSettings) { return(new UserOofSettingsSerializer { InternalReply = ReplyBodySerializer.Serialize(userOofSettings.InternalReply), ExternalReply = ReplyBodySerializer.Serialize(userOofSettings.ExternalReply), Duration = userOofSettings.Duration, OofState = userOofSettings.OofState, ExternalAudience = userOofSettings.ExternalAudience, SetByLegacyClient = userOofSettings.SetByLegacyClient, UserChangeTime = userOofSettings.UserChangeTime }); }
private ReplyBodySerializer Read5_ReplyBodySerializer(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.id11_ReplyBodySerializer || xmlQualifiedName.Namespace != this.id2_Item)) { throw base.CreateUnknownTypeException(xmlQualifiedName); } if (flag) { return(null); } ReplyBodySerializer replyBodySerializer = new ReplyBodySerializer(); bool[] array = new bool[2]; while (base.Reader.MoveToNextAttribute()) { if (!base.IsXmlnsAttribute(base.Reader.Name)) { base.UnknownNode(replyBodySerializer); } } base.Reader.MoveToElement(); if (base.Reader.IsEmptyElement) { base.Reader.Skip(); return(replyBodySerializer); } 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.id12_Message && base.Reader.NamespaceURI == this.id2_Item) { replyBodySerializer.Message = base.Reader.ReadElementString(); array[0] = true; } else if (!array[1] && base.Reader.LocalName == this.id13_LanguageTag && base.Reader.NamespaceURI == this.id2_Item) { replyBodySerializer.LanguageTag = base.Reader.ReadElementString(); array[1] = true; } else { base.UnknownNode(replyBodySerializer, ":Message, :LanguageTag"); } } else { base.UnknownNode(replyBodySerializer, ":Message, :LanguageTag"); } base.Reader.MoveToContent(); base.CheckReaderCount(ref num, ref readerCount); } base.ReadEndElement(); return(replyBodySerializer); }