Example #1
0
        /// <summary>
        /// Return Serialized String version of [data] Object
        /// </summary>
        /// <param name="data">as RecentUpdate</param>
        /// <returns></returns>
        /// <remarks></remarks>
        private static string XMLSerializeToString(RecentUpdate data)
        {
            try
            {
                XmlSerializer xmlSer = new XmlSerializer(typeof(RecentUpdate));
                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;
            }
        }
Example #2
0
        /// <summary>
        /// Set Base to value of [data]
        /// </summary>
        /// <param name="data">as recent update</param>
        /// <returns></returns>
        internal Boolean SetBase(RecentUpdate data)
        {
            try
            {
                Title = data.Title;
                Icon = data.Icon;
                Link = data.Link;
                PublishedDate = data.PublishedDate;
                Comments = data.Comments;
                Description = data.Description;

                return true;
            }
            catch (Exception ex)
            {
                GetLastError = ex;
                throw ex;
            }
        }