Example #1
0
        internal ISerializableValue WrapRawValue(Type type, object value)
        {
            RegisteredType     registeredType    = GetRegisteredType(type);
            ISerializableValue serializableValue = registeredType.Wrapper(this, type, value);

            return(serializableValue);
        }
Example #2
0
        internal ISerializableValue Instantiate(Type type, PainlessBinaryReader reader)
        {
            RegisteredType     registeredType = GetRegisteredType(type);
            ISerializableValue value          = registeredType.Instantiator(this, type, reader);

            return(value);
        }
Example #3
0
        uint RegisterTypeInternal(ref uint nextIdVariable, Type type, TypeSignatureCreator signatureCreator, ValueInstantiator instantiator, ValueWrapper wrapper)
        {
            RegisteredType registeredType = new RegisteredType(nextIdVariable, type, signatureCreator, instantiator, wrapper);

            _registeredTypes.Add(registeredType);
            nextIdVariable++;
            return(registeredType.Id);
        }
Example #4
0
        bool TryGetSpecialRegisteredType(Type baseType, out RegisteredType registeredType)
        {
            if (baseType.IsArray)
            {
                return(_registry.TryGetRegisteredType(_registry.ArrayId, out registeredType));
            }

            registeredType = null;
            return(false);
        }
Example #5
0
        public ITypeSignature ResolveTypeSignature(Type type)
        {
            RegisteredType registeredType = GetRegisteredType(type);

            return(registeredType.TypeSignature);
        }
Example #6
0
 internal bool TryGetRegisteredType(Type type, out RegisteredType registeredType)
 {
     return(_registeredTypes.TryGetValue(type, out registeredType));
 }