Esempio n. 1
0
 /// <summary>
 ///     Prepare serializers for all TL objects in an assembly.
 ///     For all objects with TLObject attribute should be prepared a serializer.
 /// </summary>
 /// <param name="assembly">Assembly with TL objects.</param>
 public void PrepareSerializersForAllTLObjectsInAssembly(Assembly assembly)
 {
     foreach (TypeInfo typeInfo in assembly.DefinedTypes.Where(typeInfo => typeInfo.GetCustomAttribute <TLObjectAttribute>() != null))
     {
         _serializersBucket.PrepareSerializer(typeInfo.AsType());
     }
 }
Esempio n. 2
0
 /// <summary>
 ///     Prepare serializer for an object type.
 /// </summary>
 /// <typeparam name="T">Type of an object.</typeparam>
 public void PrepareSerializer <T>()
 {
     _serializersBucket.PrepareSerializer <T>();
 }