예제 #1
0
 public CustomType(Type type, byte typeCode, SerializationFunc serializationFunc, DeserializationFunc deserializationFunc)
 {
     this.Type                = type;
     this.TypeCode            = typeCode;
     this.SerializationFunc   = serializationFunc;
     this.DeserializationFunc = deserializationFunc;
 }
예제 #2
0
        public static void RegisterCustomType(Type type, byte typeCode, SerializationFunc serializationFunc, DeserializationFunc deserializationFunc)
        {
            if (typeDict.ContainsKey(type))
            {
                return;
            }
            var customClass = new CustomClass(type, typeCode, serializationFunc, deserializationFunc);

            typeDict.Add(type, customClass);
            typeCodeDict.Add(typeCode, customClass);
        }
예제 #3
0
 public FuncFormatter(GetSizeFunc <T> getSizeFunc, SerializationFunc <T> serializationFunc, DeserializationFunc <T> deserializationFunc)
 {
     _getSizeFunc         = getSizeFunc;
     _serializationFunc   = serializationFunc;
     _deserializationFunc = deserializationFunc;
 }