Ejemplo n.º 1
0
        public async Task Uninstall(IContentInstallationService contentInstallation,
                                    IContentAction <IUninstallableContent> uninstallLocalContentAction)
        {
            await UninstallInternal(contentInstallation, uninstallLocalContentAction).ConfigureAwait(false);

            PrepareEvent(new UninstallActionCompleted(uninstallLocalContentAction, this));
        }
Ejemplo n.º 2
0
 public PerformUpdateHandler(IStateHandler stateHandler,
                             IContentInstallationService contentInstallation, IUpdateHandler updateHandler)
 {
     _stateHandler        = stateHandler;
     _contentInstallation = contentInstallation;
     _updateHandler       = updateHandler;
 }
Ejemplo n.º 3
0
        public async Task Install(IContentInstallationService installationService,
                                  DownloadContentAction installAction)
        {
            await InstallInternal(installationService, installAction).ConfigureAwait(false);

            PrepareEvent(new InstallActionCompleted(installAction, this));
        }
Ejemplo n.º 4
0
 protected override async Task InstallImpl(IContentInstallationService installationService,
     IDownloadContentAction<IInstallableContent> action) {
     await base.InstallImpl(installationService, action).ConfigureAwait(false);
     // TODO
     //await new GtaPackager(InstalledState.Directory).HandlePackages().ConfigureAwait(false);
     HandleBackups();
 }
Ejemplo n.º 5
0
        async Task <int> PlayInternal(IGameLauncherFactory factory, IContentInstallationService contentInstallation,
                                      IPlayContentAction <IContent> action)
        {
            ConfirmPlay();
            await InstallInternal(contentInstallation, action.ToInstall()).ConfigureAwait(false);

            return(await LaunchInternal(factory, action).ConfigureAwait(false));
        }
Ejemplo n.º 6
0
 protected override Task InstallImpl(IContentInstallationService installationService,
                                     IDownloadContentAction <IInstallableContent> action)
 {
     foreach (var m in GetPackagedContent(action.Content).Select(x => new RvMod(this, x)))
     {
         m.Register();
     }
     return(base.InstallImpl(installationService, action));
 }
Ejemplo n.º 7
0
 public AddExternalModHandler(IDbContextLocator dbContextLocator,
                              IContentInstallationService contentInstallation, IExternalFileDownloader fd,
                              IExternalDownloadStateHandler state)
     : base(dbContextLocator)
 {
     _contentInstallation = contentInstallation;
     _fd    = fd;
     _state = state;
 }
Ejemplo n.º 8
0
        protected override async Task InstallImpl(IContentInstallationService installationService,
                                                  IDownloadContentAction <IInstallableContent> action)
        {
            await base.InstallImpl(installationService, action).ConfigureAwait(false);

            // TODO
            //await new GtaPackager(InstalledState.Directory).HandlePackages().ConfigureAwait(false);
            HandleBackups();
        }
Ejemplo n.º 9
0
        async Task UninstallInternal(IContentInstallationService contentInstallation,
                                     IContentAction <IUninstallableContent> uninstallContentAction)
        {
            //ConfirmUninstall()
            await UninstallImpl(contentInstallation, uninstallContentAction).ConfigureAwait(false);

            foreach (var c in uninstallContentAction.Content.Select(x => x.Content).OfType <Content>())
            {
                Contents.Remove(c);
            }
        }
Ejemplo n.º 10
0
 protected override Task InstallImpl(IContentInstallationService installationService,
                                     IDownloadContentAction <IInstallableContent> action)
 {
     foreach (var m in GetPackagedContent(action.Content).OfType <ModNetworkContent>())
     {
         m.RegisterAdditionalPostInstallTask(async processed => {
             if (processed)
             {
                 await InstallMod(m).ConfigureAwait(false);
             }
         });
     }
     return(base.InstallImpl(installationService, action));
 }
Ejemplo n.º 11
0
 protected override Task UninstallImpl(IContentInstallationService installationService,
                                       IContentAction <IUninstallableContent> action)
 {
     foreach (var m in action.Content.OfType <ModNetworkContent>())
     {
         m.RegisterAdditionalPreUninstallTask(async processed => {
             if (processed)
             {
                 await UninstallMod(m).ConfigureAwait(false);
             }
         });
     }
     return(base.UninstallImpl(installationService, action));
 }
Ejemplo n.º 12
0
 public InstallContentHandler(IDbContextLocator dbContextLocator,
                              IContentInstallationService contentInstallation)
     : base(dbContextLocator)
 {
     _contentInstallation = contentInstallation;
 }
Ejemplo n.º 13
0
 public AbortCommandHandler(IContentInstallationService contentInstallation)
 {
     _contentInstallation = contentInstallation;
 }
Ejemplo n.º 14
0
 protected abstract Task UninstallImpl(IContentInstallationService contentInstallation,
                                       IContentAction <IUninstallableContent> action);
Ejemplo n.º 15
0
 protected abstract Task InstallImpl(IContentInstallationService installationService,
                                     IDownloadContentAction <IInstallableContent> action);
Ejemplo n.º 16
0
 Task InstallInternal(IContentInstallationService contentInstallation,
                      IDownloadContentAction <IInstallableContent> installAction)
 {
     ConfirmInstall();
     return(InstallImpl(contentInstallation, installAction));
 }
Ejemplo n.º 17
0
 public UninstallInstalledItemHandler(IDbContextLocator dbContextLocator,
                                      IContentInstallationService contentInstallation) : base(dbContextLocator)
 {
     _contentInstallation = contentInstallation;
 }
Ejemplo n.º 18
0
 public Task <int> Play(IGameLauncherFactory factory,
                        IContentInstallationService contentInstallation, IPlayContentAction <Content> action)
 => PlayInternal(factory, contentInstallation, action);
Ejemplo n.º 19
0
 protected override Task UninstallImpl(IContentInstallationService contentInstallation,
                                       IContentAction <IUninstallableContent> action)
 => contentInstallation.Uninstall(GetUninstallAction(action));
Ejemplo n.º 20
0
 protected override Task InstallImpl(IContentInstallationService installationService,
                                     IDownloadContentAction <IInstallableContent> action)
 => installationService.Install(GetInstallAction(action));
Ejemplo n.º 21
0
 public PlayContentHandler(IDbContextLocator gameContext, IGameLauncherFactory factory,
                           IContentInstallationService contentInstallation) : base(gameContext)
 {
     _factory             = factory;
     _contentInstallation = contentInstallation;
 }
Ejemplo n.º 22
0
 public ShutdownCommandHandler(IShutdownHandler shutdownHandler, IContentInstallationService contentInstallation)
 {
     _shutdownHandler     = shutdownHandler;
     _contentInstallation = contentInstallation;
 }