19 public static class SerializationFormatterFactory
24 public static ISerializationFormatter GetFormatter()
27 if (ApplicationContext.SerializationFormatter == ApplicationContext.SerializationFormatters.BinaryFormatter)
28 return new BinaryFormatterWrapper();
30 else if (ApplicationContext.SerializationFormatter == ApplicationContext.SerializationFormatters.NetDataContractSerializer)
31 return new NetDataContractSerializerWrapper();
35 if (ApplicationContext.SerializationFormatter == ApplicationContext.SerializationFormatters.CustomFormatter)
37 string customFormatterTypeName = ConfigurationManager.AppSettings[
"CslaSerializationFormatter"];
38 return (ISerializationFormatter)MethodCaller.CreateInstance(Type.GetType(customFormatterTypeName,
true,
true));