コード例 #1
0
        public t PropertyValue(object ItemValidated)
        {
            if (PropInfo != null)
            {
                return((t)PropInfo.GetMethod.Invoke(ItemValidated, null));
            }
            else if (ItemValidated != null && PropertyName.IsNotNullOrBlank())
            {
                PropertyInfo propInfo = ItemValidated.GetType().GetProperty(PropertyName);

                object result = propInfo.GetMethod.Invoke(ItemValidated, null);
                if (result == null)
                {
                    return(default(t));
                }
                return((t)result);
            }
            else
            {
                return(default(t));
            }
        }