private bool TryGetParamterValue(ActivatorParameterDescriptor context)
            {
                var entries = DictionaryExtension.ToDictionary((IEnumerable)context.Argument);

                foreach (var entry in entries)
                {
                    //判断当前参数名是否与字典条目的键相同
                    var found = string.Equals(entry.Key?.ToString(), context.ParameterName, StringComparison.OrdinalIgnoreCase);

                    if (found)
                    {
                        object value;

                        if (Convert.TryConvertValue(entry.Value, context.ParameterType, out value))
                        {
                            context.ParameterValue = value;
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                }

                return(false);
            }
            private bool TryGetParameters(ConstructorInfo constructor, object argument, Func <ActivatorParameterDescriptor, bool> binder, out object[] values)
            {
                var parameters = constructor.GetParameters();

                values = new object[parameters.Length];

                if (binder == null)
                {
                    binder = ctx => this.TryGetParamterValue(ctx);
                }

                for (int i = 0; i < parameters.Length; i++)
                {
                    var context = new ActivatorParameterDescriptor(parameters[i].Name, parameters[i].ParameterType, argument);

                    if (binder(context))
                    {
                        values[i] = context.ParameterValue;
                    }
                    else
                    {
                        return(false);
                    }
                }

                return(true);
            }