GetPublicInstanceProperties() public method

public GetPublicInstanceProperties ( ) : IEnumerable
return IEnumerable
 private object CreateObjectFromArguments(IEnumerable<KeyValuePair<string,string>> parsedArguments, Parameter paramInfo)
 {
     var obj = Activator.CreateInstance(paramInfo.ParameterType);
     foreach (
         PropertyInfo prop in paramInfo.GetPublicInstanceProperties())
     {
         var recognizedArgument = parsedArguments.First(a => a.Key.EqualsIC(prop.Name));
         prop.SetValue(obj, ConvertFrom(recognizedArgument, prop.PropertyType), null);
     }
     return obj;
 }
Example #2
0
 private void AddArgumentWithOptionsForPropertiesOnObject(List<Argument> recognizers, Parameter parameterInfo)
 {
     recognizers.AddRange(parameterInfo.GetPublicInstanceProperties()
         .Select(prop =>
             new Argument(prop.Name,
                 required: parameterInfo.LooksRequired() && IsRequired(prop),
                 type: prop.PropertyType)));
 }