Example #1
0
 public bool IsEnumProperty(string propertyName)
 {
     if (null == _EnumPropertyList || 0 == EnumPropertyList.Count)
     {
         return(false);
     }
     return(EnumPropertyList.Contains(propertyName));
 }
Example #2
0
        /// <summary>获取属性的信息</summary>
        protected virtual void GetPropertyInfo()
        {
            PropertyInfo[] entityProperties = Type.GetProperties();

            foreach (PropertyInfo property in entityProperties)
            {
                if (NotDataFilterAttribute.IsDefined(property))
                {
                    continue;
                }
                //if ("UserVSRight" == property.Name)
                //{
                //    PropertyInfo[] myPropertyInfo;
                //    // Get the properties of 'Type' class object.
                //    myPropertyInfo = property.PropertyType.GetProperties();
                //    x.Say("Properties of UserVSRight are:");
                //    for (int i = 0; i < myPropertyInfo.Length; i++)
                //    {
                //        x.Say(myPropertyInfo[i].ToString());
                //    }
                //}

                //if (property.PropertyType.IsEnum)
                //{
                //    EnumPropertyList.Add(property.Name);
                //}
                if (IsEnumType(property.PropertyType))
                {
                    EnumPropertyList.Add(property.Name);
                }
                if (IsListType(property.PropertyType))
                {
                    ListPropertyList.Add(property.Name);
                }
                PropertyArr.Add(property);
                PropertyNames.Add(property.Name);
                PropertyDic.Add(property.Name, property);
            }
        }