Beispiel #1
0
        public override VerifiableObjectContext Resolve(Type declaringType, IDictionary <string, object> keyValueCollection)
        {
            var handler  = MemberHandlerResolver.Resolve(declaringType);
            var impl     = new MemberObjectContractImpl(handler);
            var contract = new VerifiableObjectContract(impl);

            return(contract.WithDictionary(keyValueCollection));
        }
Beispiel #2
0
        public override VerifiableObjectContext Resolve <T>(IDictionary <string, object> keyValueCollection, string instanceName)
        {
            var handler  = MemberHandlerResolver.Resolve <T>();
            var impl     = new MemberObjectContractImpl(handler);
            var contract = new VerifiableObjectContract(impl);

            return(contract.WithDictionary(keyValueCollection, instanceName));
        }
Beispiel #3
0
        public override VerifiableObjectContext Resolve <T>(T instance)
        {
            if (instance is VerifiableObjectContext objectContext)
            {
                return(objectContext);
            }
            if (instance is VerifiableMemberContext memberContext)
            {
                return(memberContext.ConvertToObjectContext());
            }

            var handler  = MemberHandlerResolver.Resolve <T>();
            var impl     = new MemberObjectContractImpl(handler);
            var contract = new VerifiableObjectContract(impl);

            return(contract.WithInstance(instance));
        }
Beispiel #4
0
        public override VerifiableObjectContext Resolve(Type declaringType, object instance, string instanceName)
        {
            if (instance is VerifiableObjectContext objectContext)
            {
                return(objectContext);
            }
            if (instance is VerifiableMemberContext memberContext)
            {
                return(memberContext.ConvertToObjectContext());
            }

            var handler  = MemberHandlerResolver.Resolve(declaringType);
            var impl     = new MemberObjectContractImpl(handler);
            var contract = new VerifiableObjectContract(impl);

            return(contract.WithInstance(instance, instanceName));
        }