public async Task HandleAsync(DomainEventContext context, FirstLaunchIndicatedEvent @event)
        {
            using (await IsolatedDatabaseAccess.Open())
            {
                _database.UsageStatistics.FirstLaunchTime = @event.Time;
            }

            await context.EmitAsync(new ActionSucceededNotification());
        }
Пример #2
0
        public async Task HandleAsync(DomainEventContext context, ProxySettingsLoadedEvent @event)
        {
            using (await IsolatedDatabaseAccess.Open())
            {
                _database.ProxySettings = @event.ProxySettings;
            }

            await context.EmitAsync(new ProxySettingsLoadedNotification(@event.ProxySettings));
        }
Пример #3
0
        public async Task HandleAsync(DomainEventContext context, GameStartedEvent @event)
        {
            using (await IsolatedDatabaseAccess.Open())
            {
                _database.GameLaunchingStatuses[@event.FilePath] = @event.Status;
            }

            await context.EmitAsync(new ApplicationStartedNotification(@event.Status));
        }
Пример #4
0
        public async Task HandleAsync(DomainEventContext context, LastEditedGameProfileUpdatedEvent @event)
        {
            using (await IsolatedDatabaseAccess.Open())
            {
                _database.LastEditedGameProfileId = @event.Id;
            }

            await context.EmitAsync(new ActionSucceededNotification());
        }
        public async Task HandleAsync(DomainEventContext context, TextureManagementSettingsUpdatedEvent @event)
        {
            using (await IsolatedDatabaseAccess.Open())
            {
                _database.TextureManagementSettings = @event.Settings;
            }

            await context.EmitAsync(new ActionSucceededNotification());
        }
        public async Task HandleAsync(DomainEventContext context, ProxyActivationStatusLoadedEvent @event)
        {
            using (await IsolatedDatabaseAccess.Open())
            {
                _database.ProxyActivationStatuses[@event.ApplicationFilePath] = @event.ActivationStatus;
            }

            await context.EmitAsync(new ProxyActivationStatusLoadedNotification(@event.ActivationStatus));
        }
        public async Task HandleAsync(DomainEventContext context, ApplicationSettingsUpdatedEvent @event)
        {
            using (await IsolatedDatabaseAccess.Open())
            {
                _database.ConstantSettings.ApplicationCommunicationPort = @event.ApplicationCommunicationPort;
                _database.ConstantSettings.ProxyCommunicationPort       = @event.ProxyCommunicationPort;
            }

            await context.EmitAsync(new ActionSucceededNotification());
        }
Пример #8
0
        public async Task HandleAsync(DomainEventContext context, InitializeEvent @event)
        {
            using (await IsolatedDatabaseAccess.Open())
            {
                _database.ConstantSettings.ApplicationCommunicationPort = @event.ApplicationSettings.ApplicationCommunicationPort;
                _database.ConstantSettings.ProxyCommunicationPort       = @event.ApplicationSettings.ProxyCommunicationPort;
                _database.Games.Clear();
                _database.Games.AddRange(@event.Games);
                _database.LastEditedGameProfileId   = @event.LastEditedGameProfileId;
                _database.TextureManagementSettings = @event.TextureManagementSettings;
                _database.UsageStatistics           = @event.UsageStatistics;
            }

            await context.EmitAsync(new ActionSucceededNotification());
        }
Пример #9
0
        public async Task HandleAsync(DomainEventContext context, GameUpdatedEvent @event)
        {
            using (await IsolatedDatabaseAccess.Open())
            {
                var game = FindGameById(@event.Id);
                if (game == null)
                {
                    throw new EntityNotFoundException($"game with id: {@event.Id} could not be found");
                }

                game.Name     = @event.Name;
                game.FilePath = @event.FilePath;
            }

            await context.EmitAsync(new ActionSucceededNotification());
        }
Пример #10
0
        public async Task HandleAsync(DomainEventContext context, GameProfileUpdatedEvent @event)
        {
            using (await IsolatedDatabaseAccess.Open())
            {
                var game = FindGameByProfileId(@event.GameProfile.Id);
                if (game == null)
                {
                    throw new EntityNotFoundException($"game with game profile id: {@event.GameProfile.Id} could not be found");
                }

                game.Profiles.Remove(gameProfile => gameProfile.Id == @event.GameProfile.Id);
                game.Profiles.Add(@event.GameProfile);
            }

            await context.EmitAsync(new ActionSucceededNotification());
        }