public async Task InitializeAsync()
        {
            using (new ProcessingScope(this))
            {
                _settings = await _findTextureManagementSettingsQuery.FindAsync();

                _textures.Clear();

                TexturePreview.ShowEmpty();
                if (_settings.SourceDirectory.IsNullOrEmpty())
                {
                    return;
                }

                IEnumerable <TextureFile> files = null;
                await _actionBuilder.Dispatch(new LoadTextureFilesCommand(_settings.SourceDirectory))
                .CompleteFor <TextureFilesLoadedNotification>((context, @event) => files = @event.Files)
                .CompleteFor <ErrorOccuredNotification>(async(context, @event) => await PublishUnknownErrorEventAsync())
                .OnTimeout(async() => await PublishTimeoutEventAsync())
                .Execute();

                _textures.AddRange(files
                                   .OrderBy(file => file.Length)
                                   .ThenBy(file => file.FilePath)
                                   .Select(file => new TextureNodeViewModel(file, this, _filePicker, TexturePreview)));
            }

            Rebind();
        }
 public async Task SaveAsync(TextureManagementSettings textureManagementSettings)
 {
     using (await IsolatedDatabaseAccess.Open())
     {
         _context.TextureConverterSettings = textureManagementSettings.Clone();
         _context.Commit();
     }
 }
Exemple #3
0
 public InitializeEvent(
     ApplicationSettings applicationSettings,
     IEnumerable <Game> games,
     Guid?lastEditedGameProfileId,
     TextureManagementSettings textureManagementSettings,
     UsageStatistics usageStatistics)
 {
     ApplicationSettings = applicationSettings;
     Games = games;
     LastEditedGameProfileId   = lastEditedGameProfileId;
     TextureManagementSettings = textureManagementSettings;
     UsageStatistics           = usageStatistics;
 }
 public TextureManagementSettingsUpdatedEvent(TextureManagementSettings settings)
 {
     Settings = settings;
 }
Exemple #5
0
 public UpdateTextureManagementSettingsCommand(TextureManagementSettings settings)
 {
     Settings = settings;
 }