예제 #1
0
        private void LoadOption(System.Reflection.FieldInfo field, ArgumentCollection argCollection)
        {
            object     fieldValue = field.GetValue(this);
            MethodInfo argCollectionExtractOption = argCollection.GetType().GetMethod("ExtractOptional");
            MethodInfo genericExtractOption       = argCollectionExtractOption.MakeGenericMethod(field.FieldType);

            object[] args = new object[] { field.Name, fieldValue };

            object newValue = genericExtractOption.Invoke(argCollection, args);

            field.SetValue(this, newValue);
        }