コード例 #1
0
 public static IEnumerable <PropertyInfo> GetPropertiesForAppState(Type type)
 {
     lock (syncPropsForAppState)
     {
         List <PropertyInfo> props;
         if (!propsfoprAppState.TryGetValue(type, out props))
         {
             props = new List <PropertyInfo>();
             foreach (PropertyInfo prop in type.Properties(BindingFlags.Public | BindingFlags.Instance))
             {
                 //We will load only Visual Objects or Lists
                 if (typeof(IViewModel).IsAssignableFrom(prop.PropertyType) ||
                     typeof(IDependentViewModel).IsAssignableFrom(prop.PropertyType) ||
                     TypeCacheUtils.IsAnIListOfSomethingThatImplementsIStateObject(prop.PropertyType))
                 {
                     //If this is a indexed property then skip
                     if (prop.GetIndexParameters().Length > 0)
                     {
                         continue;
                     }
                     if (TypeCacheUtils.IsExcludedPropertyForClient(prop))
                     {
                         continue;
                     }
                     props.Add(prop);
                 }
             }
             propsfoprAppState.Add(type, props);
         }
         return(props);
     }
 }