Exemple #1
0
 private void method_0()
 {
     this.AvailableWeights.Clear();
     this.CurrentWeightProperty = "";
     this.IdPropertyName        = null;
     this.ResultIds             = null;
     if (this.Results != null && this.Results.Cast <object>().Count <object>() > 0)
     {
         object obj = this.Results.Cast <object>().FirstOrDefault <object>();
         if (obj != null)
         {
             this.AvailableWeights.Clear();
             this.IdPropertyName = null;
             this.ResultIds      = new HashSet <int>();
             PropertyInfo[] properties = obj.GetType().GetProperties();
             for (int i = 0; i < properties.Length; i++)
             {
                 PropertyInfo propertyInfo = properties[i];
                 string       text         = QueryResults.smethod_1(propertyInfo);
                 if (QueryResults.smethod_2(propertyInfo.PropertyType) && text == null)
                 {
                     this.AvailableWeights.Add(propertyInfo.Name);
                 }
                 if (text != null)
                 {
                     this.IdPropertyName = text;
                     this.ResultIds      = new HashSet <int>();
                     MethodInfo methodInfo = propertyInfo.GetAccessors().First <MethodInfo>();
                     foreach (object current in this.Results)
                     {
                         this.hashSet_0.Add((int)methodInfo.Invoke(current, null));
                     }
                 }
             }
             if (!this.AvailableWeights.Contains(this.CurrentWeightProperty ?? ""))
             {
                 this.CurrentWeightProperty = this.AvailableWeights.FirstOrDefault <string>();
             }
         }
     }
 }
Exemple #2
0
        private static bool smethod_0(PropertyInfo propertyInfo_0)
        {
            string text = QueryResults.smethod_1(propertyInfo_0);

            return(text != null);
        }