Newtonsoft.Json.Tests.Serialization.TestDynamicObject.TryConvert C# (CSharp) Method

TryConvert() public method

public TryConvert ( ConvertBinder binder, object &result ) : bool
binder System.Dynamic.ConvertBinder
result object
return bool
        public override bool TryConvert(ConvertBinder binder, out object result)
        {
            Type targetType = binder.Type;

            if (targetType == typeof(IDictionary<string, object>) ||
                targetType == typeof(IDictionary))
            {
                result = new Dictionary<string, object>(_members);
                return true;
            }
            else
            {
                return base.TryConvert(binder, out result);
            }
        }