示例#1
0
 void IXmlSerializable.WriteXml(System.Xml.XmlWriter a)
 {
     a.WriteElementString("DefaultValueGroupId", DefaultValueGroupId.ToString());
     a.WriteElementString("FullName", FullName);
     a.WriteElementString("GroupRoleId", GroupRoleId.ToString());
     a.WriteStartElement("IsAnonymous");
     a.WriteValue(IsAnonymous);
     a.WriteEndElement();
     a.WriteElementString("SearchMode", SearchMode.ToString());
     a.WriteDateTimeOffset(LastActivityDate, "LastActivityDate");
     a.WriteDateTimeOffset(LastUpdatedDate, "LastUpdatedDate");
     a.WriteElementString("ProfileId", ProfileId.ToString());
     a.WriteStartElement("Properties");
     if (Properties != null)
     {
         var b = new XmlSerializer(typeof(ProfileProperty), new XmlRootAttribute("ProfileProperty"));
         foreach (IXmlSerializable i in Properties)
         {
             b.Serialize(a, i);
         }
     }
     a.WriteEndElement();
     a.WriteStartElement("RoleSet");
     if (RoleSet != null)
     {
         ((IXmlSerializable)RoleSet).WriteXml(a);
     }
     a.WriteEndElement();
     a.WriteStartElement("Source");
     if (Source != null)
     {
         ((IXmlSerializable)Source).WriteXml(a);
     }
     a.WriteEndElement();
     a.WriteElementString("SourceId", SourceId.ToString());
     a.WriteElementString("UserId", UserId.ToString());
     a.WriteElementString("UserName", UserName);
     a.WriteStartElement("MarkGroupId");
     if (MarkGroupId.HasValue)
     {
         a.WriteValue(MarkGroupId.Value);
     }
     a.WriteEndElement();
     a.WriteStartElement("SellerTreeId");
     if (SellerTreeId.HasValue)
     {
         a.WriteValue(SellerTreeId.Value);
     }
     a.WriteEndElement();
     a.WriteStartElement("IntermediateId");
     if (IntermediateId.HasValue)
     {
         a.WriteValue(IntermediateId.Value);
     }
     a.WriteEndElement();
 }
示例#2
0
        /// <summary>
        /// Escreve os dados no XML.
        /// </summary>
        /// <param name="writer"></param>
        void IXmlSerializable.WriteXml(System.Xml.XmlWriter writer)
        {
            writer.WriteElementString("ProfileId", ProfileId.ToString());
            writer.WriteElementString("UserName", this.UserName);
            writer.WriteElementString("FullName", this.FullName);
            writer.WriteElementString("SearchMode", this.SearchMode.ToString());

            writer.WriteDateTimeOffset(LastActivityDate, "LastActivityDate");
            writer.WriteDateTimeOffset(LastUpdatedDate, "LastUpdatedDate");

            writer.WriteStartElement("Source", null);
            if (Source != null)
            {
                ((IXmlSerializable)Source).WriteXml(writer);
            }

            writer.WriteEndElement();

            writer.WriteStartElement("IsAnonymous", null);
            writer.WriteValue(IsAnonymous);
            writer.WriteEndElement();

            writer.WriteStartElement("MarkGroupId");
            if (MarkGroupId.HasValue)
            {
                writer.WriteValue(MarkGroupId.Value);
            }
            writer.WriteEndElement();

            writer.WriteStartElement("SellerTreeId");
            if (SellerTreeId.HasValue)
            {
                writer.WriteValue(SellerTreeId.Value);
            }
            writer.WriteEndElement();

            writer.WriteStartElement("IntermediateId");
            if (IntermediateId.HasValue)
            {
                writer.WriteValue(IntermediateId.Value);
            }
            writer.WriteEndElement();
        }