Exemple #1
0
        /// <summary>
        /// Return Serialized String version of [data] Object
        /// </summary>
        /// <param name="data">as Taxonomy</param>
        /// <returns></returns>
        /// <remarks></remarks>
        private static string XMLSerializeToString(Taxonomy data)
        {
            try
            {
                XmlSerializer xmlSer = new XmlSerializer(typeof(Taxonomy));
                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;
            }
        }
Exemple #2
0
        /// <summary>
        /// Set MyBase to values of [data]
        /// </summary>
        /// <param name="data">as taxonomy</param>
        /// <returns></returns>
        internal Boolean SetBase(Taxonomy data)
        {
            try
            {
                TID = data.TID;
                Name = data.Name;
                Description = data.Description;
                Weight = data.Weight;

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