コード例 #1
0
 /// <summary>
 /// Used in dire circumstances.  If you encounter an older .NET object type that cannot be serialized (e.g.
 /// DataTable), and it implements <see cref="ISerializable"/>, call this method to configure the container to create a
 /// serializer that will serialize and deserialize using this interface.
 /// </summary>
 /// <typeparam name="T">The type under configuration.</typeparam>
 /// <param name="this">The type configuration to configure.</param>
 /// <returns>The configured type configuration.</returns>
 /// <seealso href="https://github.com/ExtendedXmlSerializer/home/issues/268" />
 public static ITypeConfiguration <T> UseClassicSerialization <T>(this ITypeConfiguration <T> @this)
     where T : ISerializable
 => @this.Register().Serializer().Of <ClassicSerializationAdapter <T> >();
コード例 #2
0
 public static ITypeConfiguration <T> Register <T>(this ITypeConfiguration <T> @this, Type serializerType)
 => @this.Register(new ActivatedSerializer(serializerType, Support <T> .Key));
コード例 #3
0
 public static ITypeConfiguration <T> Register <T>(this ITypeConfiguration <T> @this, Type serializerType)
 => @this.Register().Serializer().Of(serializerType);
コード例 #4
0
 public static ITypeConfiguration <T> Unregister <T>(this ITypeConfiguration <T> @this)
 => @this.Register().Serializer().None();
コード例 #5
0
 public static ITypeConfiguration <T> Register <T>(this ITypeConfiguration <T> @this, ContentModel.ISerializer serializer)
 => @this.Register().Serializer().Using(serializer);
コード例 #6
0
 public static ITypeConfiguration <T> RegisterContentComposition <T>(this ITypeConfiguration <T> @this,
                                                                     ISerializerComposer composer)
 => @this.Register().Serializer().Composer().Using(composer);
コード例 #7
0
 public static ITypeConfiguration <T> RegisterContentComposition <T>(this ITypeConfiguration <T> @this,
                                                                     Func <ISerializer, ISerializer> compose)
 => @this.Register().Serializer().Composer().ByCalling(compose);