public DeviceDetails() { InitializeComponent(); this.ExportTile.Click += (sender, e) => { var dialog = new FolderBrowserDialog(); DialogResult result = dialog.ShowDialog(); try { AdbTools.KillAdb(); File.WriteAllText(string.Format("{0}\\{1}.txt", dialog.SelectedPath, "build-prop"), buildprop.Text); using (Toast toast = new Toast("build.prop exported")) { toast.Show(); } } catch (Exception ex) { using (Toast toast = new Toast(string.Format("Error:{0}", ex.Message))) { toast.Show(); } } }; }
public async static void ExecuteKillAdb(object parameter) { await Task.Factory.StartNew(async() => { AdbTools.KillAdb(); var temp = parameter as TextBlock; if (temp != null) { await temp.Dispatcher.InvokeAsync(() => temp.Text = "ADB KILLED"); } temp = null; }); }
public MainWindow() { InitializeComponent(); _viewModel = ((ViewModelLocator)Application.Current.Resources["Locator"]).Main; this.DataContext = _viewModel; this.Logo.HeaderSubtitle.Text = "HOME"; this.Loaded += delegate { RefreshAdb.Command.Execute(this.AdbDevices); RefreshFastboot.Command.Execute(this.FastbootDevices); }; this.Closing += delegate { _viewModel.Cleanup(); FastbootTools.Kill(); AdbTools.KillAdb(); }; this.Closed += delegate { Application.Current.Shutdown(0); }; }