private object GetPropertyValue(object obj) { if (obj == null) { return(false); } IDescribable dObj = obj as IDescribable; PropertyInfo pi = obj.GetType().GetProperty(this.PropertyName); return((pi != null) ? pi.GetValue(obj) : GetPropertyValue(dObj)); }
private object GetPropertyValue(IDescribable obj) { if ((obj == null) || !obj.HasProperty(this.PropertyName)) { return(null); } switch (this.ValueType) { case 'n': return(Double.Parse(obj.Properties[this.PropertyName])); case 'B': return(Boolean.Parse(obj.Properties[this.PropertyName])); case 's': default: return(obj.Properties[this.PropertyName]); } }