Пример #1
0
        /// <summary>
        /// Return Serialized String version of [data] Object
        /// </summary>
        /// <param name="data">as EmailAddress</param>
        /// <returns></returns>
        /// <remarks></remarks>
        private static string XMLSerializeToString(EmailAddress data)
        {
            try
            {
                XmlSerializer xmlSer = new XmlSerializer(typeof(EmailAddress));
                MemoryStream ms = new MemoryStream();
                StreamReader strReader = default(StreamReader);
                string output = null;

                xmlSer.Serialize(ms, data);
                ms.Position = 0;
                strReader = new StreamReader(ms);
                output = strReader.ReadToEnd();
                return output;
            }
            catch (Exception ex)
            {
                GetLastError = ex;
                return null;
            }
        }
Пример #2
0
        /// <summary>
        /// Set MyBase to values of [data]
        /// </summary>
        /// <param name="data">as Email Address</param>
        /// <returns></returns>
        internal bool SetBase(EmailAddress data)
        {
            ID = data.ID;
            CNTID = data.CNTID;
            Email = data.Email;
            DisplayAs = data.DisplayAs;

            return true;
        }