Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="type1"></param>
 /// <returns></returns>
 private CompactPropertySerializeCache GetSerializeCache(Type type1)
 {
     lock (this._dicCache)
     {
         if (this._dicCache.ContainsKey(type1))
         {
             return(this._dicCache[type1]);
         }
         IPropertyQuicker    quicker = PropertyQuickerFactory.CreatePropertyQuicker(type1);
         List <PropertyInfo> list    = new List <PropertyInfo>();
         foreach (PropertyInfo info in type1.GetProperties())
         {
             if (info.CanRead && info.CanWrite)
             {
                 list.Add(info);
             }
         }
         if (_ComparisonProperty == null)
         {
             _ComparisonProperty = new Comparison <PropertyInfo>(CompactPropertySerializer.CompareToName);
         }
         list.Sort(_ComparisonProperty);
         CompactPropertySerializeCache cache = new CompactPropertySerializeCache(quicker, list.ToArray());
         this._dicCache.Add(type1, cache);
         return(cache);
     }
 }
Exemplo n.º 2
0
 private Class137 xrxcLalgu3(Type type_0)
 {
     lock (this.YkdcNurUyP)
     {
         if (this.YkdcNurUyP.ContainsKey(type_0))
         {
             return(this.YkdcNurUyP[type_0]);
         }
         IPropertyQuicker    quicker = PropertyQuickerFactory.CreatePropertyQuicker(type_0);
         List <PropertyInfo> list    = new List <PropertyInfo>();
         foreach (PropertyInfo info in type_0.GetProperties())
         {
             if ((info.CanRead && info.CanWrite) && (info.GetCustomAttributes(typeof(NotSerializedCompactlyAttribute), true).Length <= 0))
             {
                 list.Add(info);
             }
         }
         if (comparison_0 == null)
         {
             comparison_0 = new Comparison <PropertyInfo>(CompactPropertySerializer.smethod_0);
         }
         list.Sort(comparison_0);
         Class137 class2 = new Class137(quicker, list.ToArray());
         this.YkdcNurUyP.Add(type_0, class2);
         return(class2);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="type1"></param>
 /// <param name="quicker1"></param>
 /// <param name="obj1"></param>
 /// <param name="text1"></param>
 /// <param name="obj2"></param>
 private void SetPropertyValue(Type type1, IPropertyQuicker quicker1, object obj1, string text1, object obj2)
 {
     if (type1.IsValueType)
     {
         ReflectionHelper.SetProperty(obj1, text1, obj2);
     }
     else
     {
         quicker1.SetValue(obj1, text1, obj2);
     }
 }
Exemplo n.º 4
0
 private void method_0(Type type_0, IPropertyQuicker ipropertyQuicker_0, object object_0, string string_0, object object_1)
 {
     if (type_0.IsValueType)
     {
         ReflectionHelper.SetProperty(object_0, string_0, object_1);
     }
     else
     {
         ipropertyQuicker_0.SetValue(object_0, string_0, object_1);
     }
 }
Exemplo n.º 5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="entityType"></param>
 /// <returns></returns>
 public static IPropertyQuicker CreatePropertyQuicker(Type entityType)
 {
     lock (PropertyQuickerEmitter)
     {
         if (!PropertyQuickerDic.ContainsKey(entityType))
         {
             IPropertyQuicker quicker = (IPropertyQuicker)Activator.CreateInstance(PropertyQuickerEmitter.CreatePropertyQuickerType(entityType));
             PropertyQuickerDic.Add(entityType, quicker);
         }
         return(PropertyQuickerDic[entityType]);
     }
 }
Exemplo n.º 6
0
        public static IPropertyQuicker CreatePropertyQuicker(Type entityType)
        {
            if (entityType.IsGenericType)
            {
                return(ReflectPropertyQuicker);
            }

            lock (PropertyQuickerEmitter)
            {
                if (!PropertyQuickerDic.ContainsKey(entityType))
                {
                    Type propertyQuickerType = PropertyQuickerEmitter.CreatePropertyQuickerType(entityType);
                    //PropertyQuickerEmitter.Save();
                    IPropertyQuicker quicker = (IPropertyQuicker)Activator.CreateInstance(propertyQuickerType);
                    PropertyQuickerDic.Add(entityType, quicker);
                }

                return(PropertyQuickerDic[entityType]);
            }
        }
Exemplo n.º 7
0
 public void EsfclJixyM(IPropertyQuicker ipropertyQuicker_1)
 {
     this.ipropertyQuicker_0 = ipropertyQuicker_1;
 }
Exemplo n.º 8
0
 public Class137(IPropertyQuicker ipropertyQuicker_1, PropertyInfo[] propertyInfo_1)
 {
     this.ipropertyQuicker_0 = ipropertyQuicker_1;
     this.propertyInfo_0     = propertyInfo_1;
 }
Exemplo n.º 9
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="quicker"></param>
 /// <param name="ary"></param>
 public CompactPropertySerializeCache(IPropertyQuicker quicker, PropertyInfo[] ary)
 {
     this._PropertyQuicker = quicker;
     this._PropertyInfo    = ary;
 }