2using System.Collections.Generic;
3using System.Runtime.Serialization;
11 public static class CslaReaderWriterFactory
13 internal static Type ReaderType {
get;
set; } = typeof(CslaBinaryReader);
14 internal static Type WriterType {
get;
set; } = typeof(CslaBinaryWriter);
21 public static DataContractSerializer GetDataContractSerializer()
23 return new DataContractSerializer(
24 typeof(List<SerializationInfo>),
25 new Type[] { typeof(List<int>), typeof(
byte[]), typeof(DateTimeOffset), typeof(
char[]) });
33 public static ICslaWriter GetCslaWriter(ApplicationContext applicationContext)
35 return (ICslaWriter)applicationContext.CreateInstanceDI(WriterType);
43 public static ICslaReader GetCslaReader(ApplicationContext applicationContext)
45 return (ICslaReader)applicationContext.CreateInstanceDI(ReaderType);