Ejemplo n.º 1
0
        private static bool checkForIgnorePors(PropertyInfo propInfo)
        {
            bool      result     = false;
            WMIIgnore ignoreProp = propInfo.GetCustomAttribute <WMIIgnore>(inherit: false);


            if (ignoreProp == null)
            {
                result = true;
            }

            return(result);
        }
Ejemplo n.º 2
0
        public static List <object> getSearchPropValues(object obj)
        {
            var propsValues = new List <object>();

            foreach (var propInfo in obj.GetType().GetProperties())
            {
                WMIIgnore ignoreProp = propInfo.GetCustomAttribute <WMIIgnore>(inherit: false);
                if (ignoreProp == null)
                {
                    var value = propInfo.GetValue(obj) ?? "null";
                    propsValues.Add(value);
                }
            }

            return(propsValues);
        }
Ejemplo n.º 3
0
        public static List <string> getSearchPropsNames(Type type)
        {
            var propsList = new List <string>();

            foreach (var propInfo in type.GetProperties())
            {
                WMIIgnore ignoreProp = propInfo.GetCustomAttribute <WMIIgnore>(inherit: false);

                if (ignoreProp == null)
                {
                    string prop = getWMIPropName(propInfo);
                    if (!String.IsNullOrEmpty(prop))
                    {
                        propsList.Add(getWMIPropName(propInfo));
                    }
                }
            }

            return(propsList);
        }