Newtonsoft.Json.Tests.Serialization.TestDynamicObject.TryConvert C# (CSharp) 메소드

TryConvert() 공개 메소드

public TryConvert ( ConvertBinder binder, object &result ) : bool
binder System.Dynamic.ConvertBinder
result object
리턴 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);
            }
        }