Exemple #1
0
        protected override TStream CreateOutputStream(ToFlatFileArgs <TIn, TStream> args)
        {
            var firstStreamWriter = args.TargetStream.Observable.First().Do(i => PreProcess(i, args.Mapping)).DelayTillEndOfStream();
            var obs = args.MainStream.Observable
                      .CombineWithLatest(firstStreamWriter, (i, r) => { ProcessValueToOutput(r, args.Mapping, i); return(i); }, true);

            return(CreateMatchingStream(obs, args.MainStream));
        }
 public ToFlatFileStreamNode(string name, ToFlatFileArgs <TIn> args) : base(name, args)
 {
     _stream       = new MemoryStream();
     _streamWriter = new StreamWriter(_stream, Encoding.Default, 1024, true);
     this.ExecutionContext.AddDisposable(_streamWriter);
     _streamWriter.WriteLine(args.Mapping.GenerateDefaultHeaderLine());
     _serialize = args.Mapping.GetSerializer();
 }
        protected override IStream <Stream> CreateOutputStream(ToFlatFileArgs <TIn> args)
        {
            var obs = args.MainStream.Observable.Do(ProcessValueToOutput).Last().Map(i =>
            {
                // _streamWriter.Dispose();
                return(_stream);
            });

            return(CreateUnsortedStream(obs));
        }
Exemple #4
0
 public ToFlatFileStreamNode(string name, ToFlatFileArgs <TIn, TStream> args) : base(name, args)
 {
     _serialize = args.Mapping.GetSerializer();
 }