private static bool checkForIgnorePors(PropertyInfo propInfo) { bool result = false; WMIIgnore ignoreProp = propInfo.GetCustomAttribute <WMIIgnore>(inherit: false); if (ignoreProp == null) { result = true; } return(result); }
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); }
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); }