Ejemplo n.º 1
0
 public GameletMountChecker(IRemoteCommand remoteCommand, IDialogUtil dialogUtil,
                            CancelableTask.Factory cancelableTaskFactory)
 {
     _remoteCommand         = remoteCommand;
     _dialogUtil            = dialogUtil;
     _cancelableTaskFactory = cancelableTaskFactory;
 }
Ejemplo n.º 2
0
 // Create a task that runs the given synchronous action on a background thread.
 public static ICancelableTask Create(this CancelableTask.Factory factory, string text,
                                      Action <ICancelable> action) => factory.Create(
     text, t =>
 {
     action(t);
     return(Task.CompletedTask);
 });
Ejemplo n.º 3
0
 // Constructor for tests.
 public GgpDebugQueryTarget(IFileSystem fileSystem, SdkConfig.Factory sdkConfigFactory,
                            IGameletClientFactory gameletClientFactory,
                            IApplicationClientFactory applicationClientFactory,
                            CancelableTask.Factory cancelableTaskFactory,
                            IDialogUtil dialogUtil, IRemoteDeploy remoteDeploy,
                            DebugSessionMetrics metrics,
                            ICredentialManager credentialManager,
                            ITestAccountClientFactory testAccountClientFactory,
                            IGameletSelectorFactory gameletSelectorFactory,
                            ICloudRunner cloudRunner, Versions.SdkVersion sdkVersion,
                            ChromeClientLaunchCommandFormatter launchCommandFormatter,
                            DebugEngine.DebugEngine.Params.Factory paramsFactory,
                            IYetiVSIService yetiVsiService, IGameLauncher gameLauncher)
 {
     _fileSystem               = fileSystem;
     _sdkConfigFactory         = sdkConfigFactory;
     _gameletClientFactory     = gameletClientFactory;
     _applicationClientFactory = applicationClientFactory;
     _cancelableTaskFactory    = cancelableTaskFactory;
     _dialogUtil               = dialogUtil;
     _remoteDeploy             = remoteDeploy;
     _metrics                  = metrics;
     _credentialManager        = credentialManager;
     _testAccountClientFactory = testAccountClientFactory;
     _cloudRunner              = cloudRunner;
     _yetiVsiService           = yetiVsiService;
     _gameletSelectorFactory   = gameletSelectorFactory;
     _sdkVersion               = sdkVersion;
     _launchCommandFormatter   = launchCommandFormatter;
     _paramsFactory            = paramsFactory;
     _gameLauncher             = gameLauncher;
 }
        public virtual CancelableTask.Factory GetCancelableTaskFactory()
        {
            if (_cancelableTaskFactory == null)
            {
                var taskContext           = _serviceManager.GetJoinableTaskContext();
                var progressDialogFactory = new ProgressDialog.Factory();
                _cancelableTaskFactory =
                    new CancelableTask.Factory(taskContext, progressDialogFactory);
            }

            return(_cancelableTaskFactory);
        }
Ejemplo n.º 5
0
 // Create a task that runs the given synchronous action on a background thread,
 // waits on the resulting async task, and captures its result.
 public static ICancelableTask <T> Create <T>(this CancelableTask.Factory factory, string text,
                                              Func <Task <T> > action) =>
 factory.Create(text, _ => action());
Ejemplo n.º 6
0
 // Create a task that runs the given synchronous action on a background thread and returns
 // a value.
 public static ICancelableTask <T> Create <T>(this CancelableTask.Factory factory, string text,
                                              Func <ICancelable, T> action) =>
 factory.Create(text, t => { return(Task.FromResult(action(t))); });