コード例 #1
0
        public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            string fullCodeName = (string)dictionary["fullCodeName"];

            OguRole role = new OguRole(fullCodeName);

            role.ID          = DictionaryHelper.GetValue(dictionary, "id", string.Empty);
            role.Name        = DictionaryHelper.GetValue(dictionary, "name", string.Empty);
            role.CodeName    = DictionaryHelper.GetValue(dictionary, "codeName", string.Empty);
            role.Description = DictionaryHelper.GetValue(dictionary, "description", string.Empty);

            return(role);
        }
コード例 #2
0
        /// <summary>
        /// 生成可序列化的包装类
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static IRole CreateWrapperObject(IRole obj)
        {
            IRole result = null;

            if (obj is OguRole || obj == null)
            {
                result = obj;
            }
            else
            {
                result = new OguRole(obj);
            }

            return(result);
        }
コード例 #3
0
 protected override IRole CreateWrapperObject(IRole obj)
 {
     return(OguRole.CreateWrapperObject(obj));
 }