예제 #1
0
        private static object CreateElement(IPropertyDef def, object target)
        {
            if (def == null)
            {
                throw new NotSupportedException();
            }
            var element = target != null?def.GetValue(target) : null;

            return(element ?? Activator.CreateInstance(def.Type));
        }
 public object GetValue(object target)
 {
     return(_property.GetValue(target));
 }
예제 #3
0
 private static object CreateElement(IPropertyDef def, object target)
 {
     if (def == null) throw new NotSupportedException();
     var element = target != null ? def.GetValue(target) : null;
     return element ?? Activator.CreateInstance(def.Type);
 }