Exemplo n.º 1
0
 private static ReactiveCommand <Unit, Unit> RunScriptCommand(ScriptDeployer deployer, IFilePicker filePicker)
 {
     return(ReactiveCommand.CreateFromObservable(() =>
     {
         var filter = new FileTypeFilter("Deployer Script", "*.ds", "*.txt");
         return filePicker
         .Open("Select a script", new[] { filter })
         .Where(x => x != null)
         .SelectMany(file => Observable.FromAsync(() => deployer.RunScript(file.Source.LocalPath)));
     }));
 }