Exemplo n.º 1
0
 public override Dictionary <string, string> EnumOptions(object target, string paramName)
 {
     if (target.GetType() == typeof(PackBundleSetting))
     {
         //打包//
         JsonFieldTypes pc = JsonFieldAttribute.GetFieldFlag(target, paramName);
         if (pc != JsonFieldTypes.Null)
         {
             if (pc == JsonFieldTypes.PackType)
             {
                 //分包方式//
                 return(GOEPackV5.msArrayPackType);
             }
         }
     }
     return(null);
 }
Exemplo n.º 2
0
        internal PropertyInfo[] GetGetters(Type type, JSONParameters param)
        {
            PropertyInfo[] gettersArray = null;
            if (!this._getterscache.TryGetValue(type, out gettersArray))
            {
                PropertyInfo[]      properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
                List <PropertyInfo> list       = new List <PropertyInfo>();
                foreach (PropertyInfo info in properties)
                {
                    if (!info.CanWrite && !param.ShowReadOnlyProperties)
                    {
                        continue;
                    }
                    JsonFieldTypes fieldP = JsonFieldAttribute.GetFieldFlag(info);
                    if (param.IgnoreAttributes != null && fieldP != JsonFieldTypes.Null)
                    {
                        bool flag = false;

                        foreach (JsonFieldTypes type2 in param.IgnoreAttributes)
                        {
                            if (fieldP == type2)
                            {
                                flag = true;
                                break;
                            }
                        }
                        if (flag)
                        {
                            continue;
                        }
                    }
                    list.Add(info);
                }
                gettersArray = list.ToArray();
                this._getterscache.Add(type, gettersArray);
            }
            return(gettersArray);
        }
 public JsonFieldAttribute(JsonFieldTypes type)
 {
     this._fieldType = type;
 }