Пример #1
0
        protected override IStream <IFileValue> CreateOutputStream(WriteToFileArgs <TParams> args)
        {
            var outputFilePath   = args.ParamStream.Observable.Map(args.GetOutputFilePath);
            var outputObservable = args.Stream.Observable.CombineWithLatest(outputFilePath, (fileValue, r) =>
            {
                var l = fileValue.GetContent();
                l.Seek(0, SeekOrigin.Begin);
                using (var fileStream = File.Open(r, FileMode.Create))
                    l.CopyTo(fileStream);
                return(fileValue);
            }, true);

            return(base.CreateUnsortedStream(outputObservable));
        }
Пример #2
0
 public WriteToFileStreamNode(string name, WriteToFileArgs <TParams> args) : base(name, args)
 {
 }