Пример #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);
     }
 }
Пример #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);
     }
 }