public void EntryPoint(IDevice device, ILeafUI ui, IStorageManager storageManager, IAppManager app, ICommandExecutor executor) { using (ui) { //初始化LeafUI并展示 ui.Title = this.GetName(); ui.Icon = this.GetIconBytes(); executor.OutputReceived += (s, e) => { ui.WriteOutput(e.Text); SLogger <EScreenShoter> .Info(e.Text); }; ui.Closing += (s, e) => { executor.Dispose(); return(true); }; ui.Show(); var screencap = new ScreenCap(device, executor, storageManager.CacheDirectory.FullName); var file = screencap.Cap(); ui.WriteLine(file.FullName); ShowOnUI(app, file.FullName); //显示出来了,进度窗也没啥用了,直接关闭 //ui.Finish(); ui.Shutdown(); } }
public void EntryPoint(IDevice device, ILeafUI ui, IStorage storage, IAppManager app, ICommandExecutor executor) { using (ui) { //初始化LeafUI并展示 executor.OutputReceived += (s, e) => { ui.WriteLineToDetails(e.Text); }; ui.Closing += (s, e) => { executor.Dispose(); return(true); }; ui.Show(); var screencap = new ScreenCap(device, executor, storage.CacheDirectory.FullName); var file = screencap.Cap(); ui.WriteLineToDetails(file.FullName); ShowOnUI(app, file.FullName); //显示出来了,进度窗也没啥用了,直接关闭 //ui.Finish(); ui.Shutdown(); } }
public void EntryPoint(IDevice device, ILeafUI ui, IStorage storage, IAppManager app, ICommandExecutor executor) { using (ui) { //初始化LeafUI并展示 executor.OutputReceived += (s, e) => { ui.Println(e.Text); }; ui.Closing += (s, e) => { try { executor.Dispose(); } catch { } return(true); }; ui.Show(); try { var screencap = new ScreenCap(device, executor, storage.CacheDirectory.FullName); var file = screencap.Cap(); ui.Println(file.FullName); ShowOnUI(app, file.FullName); ui.Shutdown(); } catch (CommandCancelledException) { ui.Println("Cancelled"); } catch (CommandErrorException e) { ui.ShowMessage(this.RxGetClassText("error")); ui.Println(e.ToString()); ui.Finish(StatusMessages.Failed); } } }