public static void Execute2(object parameter)
        {
            ExecuteCommandParameters parameters = parameter as ExecuteCommandParameters;

            if (parameters != null)
            {
                Context = parameters.Context;
                BackgroundWorker worker = new BackgroundWorker();
                worker.DoWork += async(sender, args) =>
                {
                    await Context.Dispatcher.InvokeAsync(async() =>
                    {
                        Fastboot = new FastbootTools(Context);
                        var cmds = new List <string>
                        {
                            parameters.Text,
                            parameters.Text2,
                            parameters.Text3,
                            parameters.Text4,
                            parameters.Text5,
                            parameters.Text6,
                            parameters.Text7,
                            parameters.Text8,
                            parameters.Text9,
                            parameters.Text10
                        };
                        await Fastboot.Execute(cmds, parameters.Bool);
                    });
                };
                worker.RunWorkerCompleted += (sender, args) => worker.Dispose();
                worker.RunWorkerAsync();
            }
        }
示例#2
0
 public AdbViewModel()
 {
     ThreeTextCommandParameters    = new ThreeTextCommandParameters();
     FiveTextCommandParameters     = new FiveTextCommandParameters();
     InstallTwoCommandParameters   = new TwoCommandParameters();
     UninstallTwoCommandParameters = new TwoCommandParameters();
     UiParameters = new UIParameters();
     ExecuteSingleCommandParameters = new TwoCommandParameters();
     CopyCommandParameters          = new ThreeTextCommandParameters();
     MoveCommandParameters          = new ThreeTextCommandParameters();
     DeleteCommandParameters        = new TwoCommandParameters();
     SideloadParameters             = new TwoCommandParameters();
     ExecuteCommandsParameters      = new ExecuteCommandParameters();
     BackupParameters           = new BackupParameters();
     RestoreParameters          = new TwoCommandParameters();
     RemoteConnectParameters    = new ThreeTextCommandParameters();
     RemoteDisconnectParameters = new SingleCommandParameters();
     RemoteSaveParameters       = new ThreeTextCommandParameters();
     _remoteInfoRepository      = ((ViewModelLocator)Application.Current.Resources["Locator"]).RemoteInfoRepository;
 }