Exemple #1
0
 public void ShouldRegisterAllSerializableTypesFromAssemblyInProperOrder()
 {
     TypeInfoRepository.RegisterPredefinedUsingSerializableFrom(GetType().Assembly);
     AssertRegistrationFor(typeof(SerializableType));
     AssertRegistrationFor(typeof(InternalSerializableType));
     Assert.That(
         TypeInfoRepository.GetTypeInfo(typeof(InternalSerializableType)).ShortTypeId,
         Is.LessThan(TypeInfoRepository.GetTypeInfo(typeof(SerializableType)).ShortTypeId));
 }
 /// <summary>
 /// Registers all classes with [Serializable] attribute in order to decrease size of serialized message containing them.
 /// </summary>
 /// <param name="assembly"></param>
 public static void RegsterSerializableFrom(Assembly assembly)
 {
     TypeInfoRepository.RegisterPredefinedUsingSerializableFrom(assembly);
 }
 static BinaryMessageSerializer()
 {
     TypeInfoRepository.RegisterPredefinedUsingSerializableFrom(typeof(TransportLayerResolver).Assembly);
 }