Esempio n. 1
0
        public static PropertyInfo[] GetBrowsableProperties(this object obj)
        {
            string key = obj.GetType().ToString();

            if (!PCCEX.BrowsablePropertyInfos.ContainsKey(key))
            {
                List <PropertyInfo> propertyInfoList = new List <PropertyInfo>();
                PropertyInfo[]      properties       = obj.GetType().GetProperties();
                foreach (PropertyInfo property in properties)
                {
                    if ((property.PropertyType.IsSubclassOf(typeof(ObjectBase)) || property.PropertyType.GetInterface("IList") != null))
                    {
                        // only add to list of the property is NOT marked with [NotNavigable]
                        if (IsBrowsable(obj, property))
                        {
                            propertyInfoList.Add(property);
                        }
                    }
                }

                PCCEX.AddBrowsablePropertyInfo(key, propertyInfoList.ToArray());
            }

            return(PCCEX.BrowsablePropertyInfos[key]);
        }
Esempio n. 2
0
 public static bool IsBrowsable(this object obj, PropertyInfo property)
 {
     return(PCCEX.IsBrowsable(obj, property));
 }
Esempio n. 3
0
 public static void Merge <T>(this ObservableCollection <T> source, IEnumerable <T> collection, bool ignoreDuplicates)
 {
     PCCEX.Merge <T>(source, collection, ignoreDuplicates);
 }
Esempio n. 4
0
 public static bool IsNavigable(this PropertyInfo property)
 {
     return(PCCEX.IsNavigable(property));
 }
Esempio n. 5
0
 public static void Merge <T>(this ObservableCollection <T> source, IEnumerable <T> collection)
 {
     PCCEX.Merge <T>(source, collection);
 }