Exemplo n.º 1
0
 private void InitializeContract(SshContract contract)
 {
     contract.Converter         = ResolveContractConverter(contract.NonNullableUnderlyingType);
     contract.InternalConverter =
         DoodsSshRequestSerializer.GetMatchingConverter(BuiltInConverters,
                                                        contract.NonNullableUnderlyingType);
 }
Exemplo n.º 2
0
        private ISshConverter GetConverter(SshContract contract)
        {
            ISshConverter converter = null;

            if (contract != null)
            {
                ISshConverter matchingConverter;
                if (contract.Converter != null)
                {
                    converter = contract.Converter;
                }
                else if ((matchingConverter = Serializer.GetMatchingConverter(contract.UnderlyingType)) != null)
                {
                    converter = matchingConverter;
                }
                else if (contract.InternalConverter != null)
                {
                    converter = contract.InternalConverter;
                }
            }

            return(converter);
        }