/// <summary> /// Write the result to a stream /// </summary> /// <typeparam name="T">The poco type used to define file format</typeparam> /// <param name="observed">observed operation</param> /// <param name="writer">stream to the file</param> /// <param name="prepare">Callback to prepare the file engine</param> /// <returns>file write operation</returns> public static FileWriteOperation <T> WriteFile <T>(this IObservableOperation observed, TextWriter writer, Action <FluentFile> prepare) { FileWriteActivator <T> activator = new FileWriteActivator <T>() { Writer = writer, PrepareFluentFile = prepare }; FileWriteOperation <T> resoperation = new FileWriteOperation <T>(activator); observed.Subscribe(resoperation); return(resoperation); }
/// <summary> /// Write the result to a file /// </summary> /// <typeparam name="T">The poco type used to define file format</typeparam> /// <param name="observed">observed operation</param> /// <param name="filename">full path to the file</param> /// <param name="prepare">Callback to prepare the file engine</param> /// <returns>file write operation</returns> public static FileWriteOperation <T> WriteFile <T>(this IObservableOperation observed, string filename, Action <FluentFile> prepare) { FileWriteActivator <T> activator = new FileWriteActivator <T>() { FileName = filename, PrepareFluentFile = prepare }; FileWriteOperation <T> resoperation = new FileWriteOperation <T>(activator); observed.Subscribe(resoperation); return(resoperation); }
/// <summary> /// Write the result to a stream /// </summary> /// <param name="T">The poco type used to define file format</param> /// <param name="observed">observed operation</param> /// <param name="writer">stream to the file</param> /// <param name="prepare">Callback to prepare the file engine</param> /// <returns>file write operation</returns> public static FileWriteOperation WriteFile(this IObservableOperation observed, TextWriter writer, Action <FluentFile> prepare, Type T) { FileWriteActivator activator = new FileWriteActivator() { Writer = writer, PrepareFluentFile = prepare, Type = T }; FileWriteOperation resoperation = new FileWriteOperation(activator, T); observed.Subscribe(resoperation); return(resoperation); }
/// <summary> /// Write the result to a file /// </summary> /// <param name="T">The poco type used to define file format</param> /// <param name="observed">observed operation</param> /// <param name="filename">full path to the file</param> /// <param name="prepare">Callback to prepare the file engine</param> /// <returns>file write operation</returns> public static FileWriteOperation WriteFile(this IObservableOperation observed, string filename, Action <FluentFile> prepare, Type T) { FileWriteActivator activator = new FileWriteActivator() { FileName = filename, PrepareFluentFile = prepare, Type = T }; FileWriteOperation resoperation = new FileWriteOperation(activator, T); observed.Subscribe(resoperation); return(resoperation); }
/// <summary> /// Write the result to a stream /// </summary> /// <typeparam name="T">The poco type used to define file format</typeparam> /// <param name="observed">observed operation</param> /// <param name="strm">stream to the file</param> /// <param name="prepare">Callback to prepare the file engine</param> /// <returns>file write operation</returns> public static FileWriteOperation <T> WriteFile <T>(this IObservableOperation observed, Stream strm, Action <FluentFile> prepare) { var activator = new FileWriteActivator <T>() { Stream = strm, PrepareFluentFile = prepare }; var resoperation = new FileWriteOperation <T>(activator); observed.Subscribe(resoperation); return(resoperation); }
/// <summary> /// File Write constructor /// </summary> /// <param name="activator">file write parameters</param> public FileWriteOperation(FileWriteActivator <T> activator) => _activator = activator;
/// <summary> /// File Write constructor /// </summary> /// <param name="activator">file write parameters</param> /// <param name="T">class of the object</param> public FileWriteOperation(FileWriteActivator activator, Type T) { _activator = activator; _classType = T; }