public BTypeNamesXmlSerializer(BListXmlParams @params, Collections.BTypeNames list) { Contract.Requires <ArgumentNullException>(@params != null); Contract.Requires <ArgumentNullException>(list != null); mParams = @params; mList = list; }
public static void Serialize<T, TDoc, TCursor>(IO.TagElementStream<TDoc, TCursor, string> s, Collections.BListAutoId<T> list, BListXmlParams @params, bool forceNoRootElementStreaming = false) where T : class, Collections.IListAutoIdObject, new() where TDoc : class where TCursor : class { Contract.Requires(s != null); Contract.Requires(list != null); Contract.Requires(@params != null); if (forceNoRootElementStreaming) @params.SetForceNoRootElementStreaming(true); using (var xs = CreateXmlSerializer(list, @params)) { xs.Serialize(s); } if (forceNoRootElementStreaming) @params.SetForceNoRootElementStreaming(false); }
public static void Serialize <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s, Collections.BTypeNames list, BListXmlParams @params, bool forceNoRootElementStreaming = false) where TDoc : class where TCursor : class { Contract.Requires(s != null); Contract.Requires(list != null); Contract.Requires(@params != null); if (forceNoRootElementStreaming) { @params.SetForceNoRootElementStreaming(true); } using (var xs = new BTypeNamesXmlSerializer(@params, list)) { xs.Serialize(s); } if (forceNoRootElementStreaming) { @params.SetForceNoRootElementStreaming(false); } }
public static void Serialize <T, TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s, Collections.BListArray <T> list, BListXmlParams @params) where T : IO.ITagElementStringNameStreamable, new() where TDoc : class where TCursor : class { Contract.Requires(s != null); Contract.Requires(list != null); Contract.Requires(@params != null); using (var xs = new BListArrayXmlSerializer <T>(@params, list)) { xs.Serialize(s); } }
public static IBListAutoIdXmlSerializer CreateXmlSerializer<T>(Collections.BListAutoId<T> list, BListXmlParams @params) where T : class, Collections.IListAutoIdObject, new() { Contract.Requires(list != null); Contract.Requires(@params != null); var xs = new BListAutoIdXmlSerializer<T>(@params, list); return xs; }