private void UserInterfaceThreadStart()
        {
            var clientConfiguration  = ryu.Get <IClientConfiguration>();
            var fileSystemProxy      = ryu.Get <IFileSystemProxy>();
            var driveNodeFactory     = new DriveNodeFactory(ryu.Get <IStreamFactory>());
            var pofContext           = ryu.Get <IPofContext>();
            var pofSerializer        = ryu.Get <IPofSerializer>();
            var temporaryFileService = ryu.Get <ServiceClient>().GetService <TemporaryFileService>();
            var exeggutorService     = ryu.Get <ServiceClient>().GetService <ExeggutorService>();
            var riotSolutionLoader   = ryu.Get <RiotSolutionLoader>();
            var modificationLoader   = ryu.Get <ModificationLoader>();
            var leagueBuildUtilities = ryu.Get <LeagueBuildUtilities>();

            application = Application.Current ?? new Application();
            var dispatcher = application.Dispatcher;
            var window     = new MainWindow();

            var repositoriesDirectory = Path.Combine(clientConfiguration.UserDataDirectoryPath, kRepositoryDirectoryName);

            var modificationImportViewModelFactory = new ModificationImportViewModelFactory(fileSystemProxy, driveNodeFactory);
            ModificationComponentFactory modificationComponentFactory           = new ModificationComponentFactory(fileSystemProxy, pofContext, new SlotSourceFactoryImpl(), pofSerializer);
            ObservableCollection <ModificationViewModel> modificationViewModels = new ObservableCollection <ModificationViewModel>();
            var rootViewModelCommandFactory     = new ModificationImportController(pofSerializer, repositoriesDirectory, temporaryFileService, exeggutorService, modificationComponentFactory, fileSystemProxy, riotSolutionLoader, modificationImportViewModelFactory, modificationViewModels, modificationLoader, leagueBuildUtilities);
            var modificationListingSynchronizer = new ModificationListingSynchronizer(pofSerializer, fileSystemProxy, clientConfiguration, temporaryFileService, exeggutorService, modificationLoader, modificationViewModels, leagueBuildUtilities);

            modificationListingSynchronizer.Initialize();
            var rootViewModel = new RootViewModel(rootViewModelCommandFactory, window, modificationViewModels);

            window.DataContext = rootViewModel;
            application.Run(window);
            host?.Shutdown(ShutdownReason.None);
        }
示例#2
0
        public RootViewModel(ModificationImportController modificationImportController, MainWindow window, ObservableCollection <ModificationViewModel> modifications)
        {
            this.modificationImportController = modificationImportController;
            this.window        = window;
            this.Modifications = modifications;

            collectionViewSource.Source  = Modifications;
            collectionViewSource.Filter += (s, e) => {
                if (modificationTypeFilter == LeagueModificationCategory.All)
                {
                    e.Accepted = true;
                }
                else
                {
                    e.Accepted = (modificationTypeFilter.Value & ((ModificationViewModel)e.Item).Category.Value) != 0;
                }
            };
            FilteredModifications = collectionViewSource.View;
        }
 public ModificationImportViewModel(ModificationImportController modificationImportController, ModificationImportWindow importWindow, ModificationImportEntryViewModelBase rootNodeViewModel)
 {
     this.modificationImportController = modificationImportController;
     this.importWindow      = importWindow;
     this.rootNodeViewModel = rootNodeViewModel;
 }