コード例 #1
0
ファイル: Role.cs プロジェクト: MorrisonRed/DemoCode
        /// <summary>
        /// Return Serialized String version of [data] Object
        /// </summary>
        /// <param name="data">as Role</param>
        /// <returns></returns>
        /// <remarks></remarks>
        private static string XMLSerializeToString(Role data)
        {
            try
            {
                XmlSerializer xmlSer = new XmlSerializer(typeof(Role));
                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
ファイル: Role.cs プロジェクト: MorrisonRed/DemoCode
        /// <summary>
        /// Set MyBase to values of [data]
        /// </summary>
        /// <param name="data">as project role</param>
        /// <returns></returns>
        internal Boolean SetBase(Role data)
        {
            try
            {
                RoleID = data.RoleID;
                PID = data.PID;
                Name = data.Name;

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