public PlayShellView(IEventAggregator eventBus, UserSettings settings,
            INotificationCenterMessageHandler handler,
            IDialogManager dialogManager, IExceptionHandler exceptionHandler, ISpecialDialogManager specialDialogManager) {
            InitializeComponent();

            Loaded += OnRoutedEventHandler;

            _userSettings = settings;
            _handler = handler;
            _dialogManager = dialogManager;
            _exceptionHandler = exceptionHandler;
            _specialDialogManager = specialDialogManager;

            WorkaroundSystemMenu_Init();

            this.WhenActivated(d => {
                // TODO
                //d(UserError.RegisterHandler<CanceledUserError>(x => CanceledHandler(x)));
                //d(UserError.RegisterHandler<NotLoggedInUserError>(x => NotLoggedInDialog(x)));
                //d(UserError.RegisterHandler<NotConnectedUserError>(x => NotConnectedDialog(x)));
                //d(UserError.RegisterHandler<BusyUserError>(x => BusyDialog(x)));
                d(this.WhenAnyValue(x => x.ViewModel).BindTo(this, v => v.DataContext));
                d(this.OneWayBind(ViewModel, vm => vm.Overlay.ActiveItem, v => v.MainScreenFlyout.ViewModel));
                d(this.OneWayBind(ViewModel, vm => vm.SubOverlay, v => v.SubscreenFlyout.ViewModel));
                d(this.OneWayBind(ViewModel, vm => vm.StatusFlyout, v => v.StatusFlyout.ViewModel));
                d(this.WhenAnyObservable(x => x.ViewModel.ActivateWindows)
                    .ObserveOn(RxApp.MainThreadScheduler)
                    .Subscribe(x => DialogHelper.ActivateWindows(x)));
                d(TryCreateTrayIcon());
            });

            ThemeManager.IsThemeChanged += CustomThemeManager.ThemeManagerOnIsThemeChanged;
        }
 public ViewModelFactory(ExportFactory<AboutViewModel> aboutFactory,
     ExportFactory<ApplicationLicensesViewModel> licenseFactory,
     ExportFactory<AddRepositoryViewModel> repositoryFactory,
     ExportFactory<SoftwareUpdateOverlayViewModel> suFactory,
     Lazy<SoftwareUpdateSquirrelOverlayViewModel> suFactory2,
     ExportFactory<ModLibraryViewModel> mlvFactory, ExportFactory<MissionLibraryViewModel> mlv2Factory,
     UserSettings settings, IContentManager contentList, IDialogManager dm,
     Lazy<LaunchManager> lm,
     Lazy<ServersViewModel> servers,
     Lazy<ModsViewModel> mods,
     Lazy<ContentViewModel> cvm,
     Lazy<MissionsViewModel> missions, ISpecialDialogManager specialDialogManager) {
     _aboutFactory = aboutFactory;
     _licenseFactory = licenseFactory;
     _repositoryFactory = repositoryFactory;
     _suFactory = suFactory;
     _suFactory2 = suFactory2;
     _mlvFactory = mlvFactory;
     _mlv2Factory = mlv2Factory;
     _contentList = contentList;
     _settings = settings;
     _dm = dm;
     _lm = lm;
     _servers = servers;
     _mods = mods;
     _cvm = cvm;
     _missions = missions;
     _specialDialogManager = specialDialogManager;
 }
 public ViewModelFactory(ExportFactory <AboutViewModel> aboutFactory,
                         ExportFactory <ApplicationLicensesViewModel> licenseFactory,
                         ExportFactory <AddRepositoryViewModel> repositoryFactory,
                         ExportFactory <SoftwareUpdateOverlayViewModel> suFactory,
                         Lazy <SoftwareUpdateSquirrelOverlayViewModel> suFactory2,
                         ExportFactory <ModLibraryViewModel> mlvFactory, ExportFactory <MissionLibraryViewModel> mlv2Factory,
                         UserSettings settings, IContentManager contentList, IDialogManager dm,
                         Lazy <LaunchManager> lm,
                         Lazy <ServersViewModel> servers,
                         Lazy <ModsViewModel> mods,
                         Lazy <ContentViewModel> cvm,
                         Lazy <MissionsViewModel> missions, ISpecialDialogManager specialDialogManager)
 {
     _aboutFactory      = aboutFactory;
     _licenseFactory    = licenseFactory;
     _repositoryFactory = repositoryFactory;
     _suFactory         = suFactory;
     _suFactory2        = suFactory2;
     _mlvFactory        = mlvFactory;
     _mlv2Factory       = mlv2Factory;
     _contentList       = contentList;
     _settings          = settings;
     _dm                   = dm;
     _lm                   = lm;
     _servers              = servers;
     _mods                 = mods;
     _cvm                  = cvm;
     _missions             = missions;
     _specialDialogManager = specialDialogManager;
 }
 public UploadCollection(IDialogManager dialogManager, IMediator mediator,
     Func<CollectionCreatedViewModel> collectionCreatedFactory, ISpecialDialogManager specialDialogManager) {
     _dialogManager = dialogManager;
     _mediator = mediator;
     _collectionCreatedFactory = collectionCreatedFactory;
     _specialDialogManager = specialDialogManager;
 }
Beispiel #5
0
        public PlayShellView(IEventAggregator eventBus, UserSettings settings,
                             INotificationCenterMessageHandler handler,
                             IDialogManager dialogManager, IExceptionHandler exceptionHandler, ISpecialDialogManager specialDialogManager)
        {
            InitializeComponent();

            Loaded += OnRoutedEventHandler;

            _userSettings         = settings;
            _handler              = handler;
            _dialogManager        = dialogManager;
            _exceptionHandler     = exceptionHandler;
            _specialDialogManager = specialDialogManager;

            WorkaroundSystemMenu_Init();

            this.WhenActivated(d => {
                // TODO
                //d(UserError.RegisterHandler<CanceledUserError>(x => CanceledHandler(x)));
                //d(UserError.RegisterHandler<NotLoggedInUserError>(x => NotLoggedInDialog(x)));
                //d(UserError.RegisterHandler<NotConnectedUserError>(x => NotConnectedDialog(x)));
                //d(UserError.RegisterHandler<BusyUserError>(x => BusyDialog(x)));
                d(this.WhenAnyValue(x => x.ViewModel).BindTo(this, v => v.DataContext));
                d(this.OneWayBind(ViewModel, vm => vm.Overlay.ActiveItem, v => v.MainScreenFlyout.ViewModel));
                d(this.OneWayBind(ViewModel, vm => vm.SubOverlay, v => v.SubscreenFlyout.ViewModel));
                d(this.OneWayBind(ViewModel, vm => vm.StatusFlyout, v => v.StatusFlyout.ViewModel));
                d(this.WhenAnyObservable(x => x.ViewModel.ActivateWindows)
                  .ObserveOn(RxApp.MainThreadScheduler)
                  .Subscribe(x => DialogHelper.ActivateWindows(x)));
                d(TryCreateTrayIcon());
            });

            ThemeManager.IsThemeChanged += CustomThemeManager.ThemeManagerOnIsThemeChanged;
        }
Beispiel #6
0
 public UploadCollection(IDialogManager dialogManager, IMediator mediator,
                         Func <CollectionCreatedViewModel> collectionCreatedFactory, ISpecialDialogManager specialDialogManager)
 {
     _dialogManager            = dialogManager;
     _mediator                 = mediator;
     _collectionCreatedFactory = collectionCreatedFactory;
     _specialDialogManager     = specialDialogManager;
 }
 public GamesPreLaunchEventHandler(IDialogManager dialogManager, UserSettings settings,
     IronFrontService ifService, IRestarter restarter, ISpecialDialogManager specialDialogManager) {
     _dialogManager = dialogManager;
     _settings = settings;
     _ifService = ifService;
     _restarter = restarter;
     _specialDialogManager = specialDialogManager;
 }
 public GamesPreLaunchEventHandler(IDialogManager dialogManager, UserSettings settings,
                                   IronFrontService ifService, IRestarter restarter, ISpecialDialogManager specialDialogManager)
 {
     _dialogManager        = dialogManager;
     _settings             = settings;
     _ifService            = ifService;
     _restarter            = restarter;
     _specialDialogManager = specialDialogManager;
 }
        public ProfilesMenuViewModel(IMediator mediator, IDialogManager dialogManager, ISpecialDialogManager specialDialogManager) {
            _mediator = mediator;
            _dialogManager = dialogManager;
            _specialDialogManager = specialDialogManager;

            this.SetCommand(x => x.ProfilesMenuCommand).Subscribe(x => ShowProfilesMenu = !ShowProfilesMenu);
            ReactiveUI.ReactiveCommand.CreateAsyncTask(x => OpenNewProfileDialog())
                .SetNewCommand(this, x => x.AddNewProfileCommand)
                .Subscribe();
        }
        public WpfStartupManager(ICacheManager cacheManager, IDialogManager dialogManager,
            ISpecialDialogManager specialDialogManager)
            : base(cacheManager) {
            UiRoot.Main = new UiRoot(dialogManager, specialDialogManager);

            // This is the main UserError handler so that when the MainWindow is not yet existing, or no longer existing, we can handle usererrors
            // TODO: We should re-evaluate if handling UserErrors before or after the MainWindow is useful, or that they should either be handled differently
            // or that we should make sure that such errors can only occur during the life cycle of the MainWindow?
            _wpfErrorHandler = new WpfErrorHandler(dialogManager, specialDialogManager);
            UserError.RegisterHandler(x => _wpfErrorHandler.Handler(x));
        }
        public ProfilesMenuViewModel(IMediator mediator, IDialogManager dialogManager, ISpecialDialogManager specialDialogManager)
        {
            _mediator             = mediator;
            _dialogManager        = dialogManager;
            _specialDialogManager = specialDialogManager;

            this.SetCommand(x => x.ProfilesMenuCommand).Subscribe(x => ShowProfilesMenu = !ShowProfilesMenu);
            ReactiveUI.ReactiveCommand.CreateAsyncTask(x => OpenNewProfileDialog())
            .SetNewCommand(this, x => x.AddNewProfileCommand)
            .Subscribe();
        }
Beispiel #12
0
        public WpfStartupManager(ICacheManager cacheManager, IDialogManager dialogManager,
                                 ISpecialDialogManager specialDialogManager)
            : base(cacheManager)
        {
            UiRoot.Main = new UiRoot(dialogManager, specialDialogManager);

            // This is the main UserError handler so that when the MainWindow is not yet existing, or no longer existing, we can handle usererrors
            // TODO: We should re-evaluate if handling UserErrors before or after the MainWindow is useful, or that they should either be handled differently
            // or that we should make sure that such errors can only occur during the life cycle of the MainWindow?
            _wpfErrorHandler = new WpfErrorHandler(dialogManager, specialDialogManager);
            UserError.RegisterHandler(x => _wpfErrorHandler.Handler(x));
        }
        public GameSettingsOverlayViewModel(Lazy<GamesViewModel> gvm, IMediator mediator, IDialogManager dialogManager, ISpecialDialogManager specialDialogManager) {
            DisplayName = "Game Settings";
            _gvm = gvm;
            _mediator = mediator;

            this.SetCommand(x => x.ShowAdvancedStartupParamsCommand).Subscribe(ShowAdvancedStartupParams);
            this.SetCommand(x => x.GoBikGameStartupParameters).Subscribe(GoBikGameStartupParametersInfo);

            DiagnosticsMenu = new GameDiagnosticsMenu(dialogManager, specialDialogManager);

            this.WhenAnyObservable(x => x.GameSettings.Changed)
                .Where(x => x.PropertyName != "IsValid" && x.PropertyName != "Error")
                .Subscribe(x => SaveSettings(GameSettings));
        }
Beispiel #14
0
        public ModsViewModel(ModSettingsOverlayViewModel msovm,
                             ModInfoOverlayViewModel miovm, ModVersionOverlayViewModel mvovm, IDialogManager dialogManager,
                             Lazy <IUpdateManager> updateManager, IViewModelFactory factory,
                             Lazy <IContentManager> contentManager, UserSettings settings, ISpecialDialogManager specialDialogManager)
        {
            _updateManager        = updateManager;
            _contentManager       = contentManager;
            _specialDialogManager = specialDialogManager;
            _dialogManager        = dialogManager;
            _factory     = factory;
            UserSettings = settings;

            ModuleName            = ControllerModules.ModBrowser;
            DisplayName           = "Mods";
            ModSetSettingsOverlay = msovm;
            ModSetInfoOverlay     = miovm;
            ModSetVersionOverlay  = mvovm;
        }
 public PlayStartupManager(UserSettings settings, IShutdownHandler shutdownHandler,
     IFirstTimeLicense firstTimeLicense, ISystemInfo systemInfo, IUserSettingsStorage storage,
     ISoftwareUpdate softwareUpdate, Container container, ICacheManager cacheManager,
     Cache.ImageFileCache imageFileCache,
     IPreRequisitesInstaller prerequisitesInstaller, ContactList contactList,
     IContentManager contentManager, IDialogManager dialogManager,
     VersionRegistry versionRegistry, Lazy<IUpdateManager> updateManager, ISpecialDialogManager specialDialogManager)
     : base(cacheManager, dialogManager, specialDialogManager) {
     _settings = settings;
     _shutdownHandler = shutdownHandler;
     _firstTimeLicense = firstTimeLicense;
     _softwareUpdate = softwareUpdate;
     _container = container;
     _imageFileCache = imageFileCache;
     _prerequisitesInstaller = prerequisitesInstaller;
     _contactList = contactList;
     _contentManager = contentManager;
     _dialogManager = dialogManager;
     _versionRegistry = versionRegistry;
     _updateManager = updateManager;
     _systemInfo = systemInfo;
     _storage = storage;
 }
 public GameDiagnosticsMenu(IDialogManager dialogManager, ISpecialDialogManager specialDialogManager) {
     _dialogManager = dialogManager;
     _specialDialogManager = specialDialogManager;
 }
Beispiel #17
0
 public PlayStartupManager(UserSettings settings, IShutdownHandler shutdownHandler,
                           IFirstTimeLicense firstTimeLicense, ISystemInfo systemInfo, IUserSettingsStorage storage,
                           ISoftwareUpdate softwareUpdate, Container container, ICacheManager cacheManager,
                           Cache.ImageFileCache imageFileCache,
                           IPreRequisitesInstaller prerequisitesInstaller, ContactList contactList,
                           IContentManager contentManager, IDialogManager dialogManager,
                           VersionRegistry versionRegistry, Lazy <IUpdateManager> updateManager, ISpecialDialogManager specialDialogManager)
     : base(cacheManager, dialogManager, specialDialogManager)
 {
     _settings               = settings;
     _shutdownHandler        = shutdownHandler;
     _firstTimeLicense       = firstTimeLicense;
     _softwareUpdate         = softwareUpdate;
     _container              = container;
     _imageFileCache         = imageFileCache;
     _prerequisitesInstaller = prerequisitesInstaller;
     _contactList            = contactList;
     _contentManager         = contentManager;
     _dialogManager          = dialogManager;
     _versionRegistry        = versionRegistry;
     _updateManager          = updateManager;
     _systemInfo             = systemInfo;
     _storage = storage;
 }
        public GameSettingsOverlayViewModel(Lazy <GamesViewModel> gvm, IMediator mediator, IDialogManager dialogManager, ISpecialDialogManager specialDialogManager)
        {
            DisplayName = "Game Settings";
            _gvm        = gvm;
            _mediator   = mediator;

            this.SetCommand(x => x.ShowAdvancedStartupParamsCommand).Subscribe(ShowAdvancedStartupParams);
            this.SetCommand(x => x.GoBikGameStartupParameters).Subscribe(GoBikGameStartupParametersInfo);

            DiagnosticsMenu = new GameDiagnosticsMenu(dialogManager, specialDialogManager);

            this.WhenAnyObservable(x => x.GameSettings.Changed)
            .Where(x => x.PropertyName != "IsValid" && x.PropertyName != "Error")
            .Subscribe(x => SaveSettings(GameSettings));
        }
Beispiel #19
0
 public GameDiagnosticsMenu(IDialogManager dialogManager, ISpecialDialogManager specialDialogManager)
 {
     _dialogManager        = dialogManager;
     _specialDialogManager = specialDialogManager;
 }
 public WpfDialogManager(ISpecialDialogManager wm)
 {
     _wm = wm;
 }
Beispiel #21
0
 public WpfErrorHandler(IDialogManager dialogManager, ISpecialDialogManager specialDialogManager)
 {
     _dialogManager        = dialogManager;
     _specialDialogManager = specialDialogManager;
 }
 public WpfErrorHandler(IDialogManager dialogManager, ISpecialDialogManager specialDialogManager) {
     _dialogManager = dialogManager;
     _specialDialogManager = specialDialogManager;
 }
Beispiel #23
0
 public UiRoot(IDialogManager dialogManager, ISpecialDialogManager specialDialogManager) {
     ErrorHandler = new WpfErrorHandler(dialogManager, specialDialogManager);
 }
        public ServerLibraryViewModel(Game game, Lazy <ServersViewModel> serversVm, IContentManager contentList,
                                      IServerList serverList, LaunchManager launchManager, IDialogManager dialogManager, ISpecialDialogManager specialDialogManager)
        {
            _serversVm            = serversVm;
            _contentList          = contentList;
            Settings              = DomainEvilGlobal.Settings;
            _launchManager        = launchManager;
            ServerList            = serverList;
            _dialogManager        = dialogManager;
            _specialDialogManager = specialDialogManager;

            SearchItem = new SearchServerLibraryItemViewModel(this, new CleanServerFilter());

            this.SetCommand(x => x.JoinServ);
            JoinServ.RegisterAsyncTask(
                x => JoinServer((Server)x))
            .Subscribe();

            this.SetCommand(x => x.ServerInfoCommand).Cast <Server>().Subscribe(ServerInfo);
            UpdateCommand = UiTaskHandlerExtensions.CreateCommand("UpdateCommand", true, true);
            UpdateCommand.RegisterAsyncTaskVoid <Server>(UpdateServer).Subscribe();
            this.SetCommand(x => x.ResetFiltersCommand).Subscribe(RefreshFilter);
            this.SetCommand(x => x.Note).Cast <Server>().Subscribe(ShowNotes);

            ViewType = Settings.ServerOptions.ViewType;
            this.ObservableForProperty(x => x.ViewType)
            .Select(x => x.Value)
            .BindTo(Settings, s => s.ServerOptions.ViewType);

            this.WhenAnyValue(x => x.ActiveItem)
            .Skip(1)
            .Subscribe(x => game.CalculatedSettings.Server = x);

            DomainEvilGlobal.SelectedGame.WhenAnyValue(x => x.ActiveGame.CalculatedSettings.Server)
            .Subscribe(x => ActiveItem = x);

            var playerSortDescriptions =
                new[] {
                new SortDescription("Score", ListSortDirection.Descending),
                new SortDescription("Deaths", ListSortDirection.Ascending)
            };

            Players = new ReactiveList <Player>();
            Players.EnableCollectionSynchronization(_playersLock);
            PlayersView = Players.SetupDefaultCollectionView(playerSortDescriptions, null, null, null, true);

            this.WhenAnyValue(x => x.SelectedItem.SelectedItem)
            .OfType <Server>()
            .BindTo(this, x => x.SelectedServer);

            this.WhenAnyValue(x => x.SelectedServer.Players)
            .ObserveOn(RxApp.MainThreadScheduler)
            .Subscribe(UpdatePlayers);

            this.WhenAnyValue(x => x.SelectedItem.SelectedItem)
            .Subscribe(x => {
                if (x == null)
                {
                    Players.Clear();
                }
            });

            IsLoading = true;
        }