Наследование: withSIX.Core.Helpers.PropertyChangedBase, IEnableLogging
        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 async Task Set(UserSettings settings) {
            Contract.Requires<ArgumentNullException>(settings != null);

            var versions = await GetOrCreateVersionsIndex();
            versions.Register(settings.Version);
            await _cache.InsertObject(GetKey(settings.Version), settings);
            await SetVersions(versions);
        }
 public GamesPreLaunchEventHandler(IDialogManager dialogManager, UserSettings settings,
     IronFrontService ifService, IRestarter restarter, ISpecialDialogManager specialDialogManager) {
     _dialogManager = dialogManager;
     _settings = settings;
     _ifService = ifService;
     _restarter = restarter;
     _specialDialogManager = specialDialogManager;
 }
        public AppOverlayViewModel(UserSettings settings, IDialogManager dialogManager) {
            DisplayName = "External Apps";
            _userSettings = settings;
            _dialogManager = dialogManager;

            this.SetCommand(x => x.AddAppCommand).RegisterAsyncTask(AddApp).Subscribe();
            this.SetCommand(x => x.RemoveAppCommand).Subscribe(x => RemoveApp((ExternalApp) x));

            ExternalApps.EnableCollectionSynchronization(_externalAppsLock);
        }
        public SettingsViewModel(UserSettings settings, IDialogManager dialogManager, IRestarter restarter) {
            _dialogManager = dialogManager;
            DisplayName = "Settings";
            _settings = settings;

            // create accent color menu items for the demo
            Accents = ThemeInfo.Accents
                .Select(
                    a => new AccentColorMenuData {Name = a.Name, ColorBrush = a.ColorBrush}).ToList();

            // create metro theme color menu items for the demo
            Themes = ThemeInfo.Themes
                .Select(
                    a =>
                        new AppThemeMenuData {
                            Name = a.Name,
                            BorderColorBrush = a.BorderColorBrush,
                            ColorBrush = a.ColorBrush
                        }).ToList();

            DiagnosticsMenu = new DiagnosticsMenu(_dialogManager, restarter);

            // Task.Run because RXCommand does not throw exceptions in Subscribe.
            ReactiveCommand.CreateAsyncTask(x => Task.Run(() => Logout()))
                .SetNewCommand(this, x => x.LogoutCommand)
                .Subscribe();
            ReactiveCommand.CreateAsyncTask(
                x => Cheat.PublishEventUi(new RequestGameSettingsOverlay(Guid.Empty)))
                .SetNewCommand(this, x => x.GameSettingsCommand)
                .Subscribe();

            _settings.WhenAnyValue(x => x.GameOptions.SteamDirectory)
                .BindTo(this, x => x.SteamDirectory);

            this.WhenAnyValue(x => x.SteamDirectory)
                .Select(x => x == DefaultSteamDirectory ? null : x)
                .Where(x => x == null || x.IsValidAbsoluteDirectoryPath())
                .BindTo(_settings.GameOptions, x => x.SteamDirectory);

            this.WhenAnyValue(x => x.DefaultSteamDirectory)
                .Where(x => string.IsNullOrWhiteSpace(SteamDirectory) && !string.IsNullOrWhiteSpace(x))
                .Subscribe(x => SteamDirectory = x);

            SetupPropertyGrid();
        }
 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;
 }
Пример #8
0
        public static void Initialize(UserSettings settings) {
            _settings = settings;
            Common.Paths.LogPath.MakeSurePathExists();
            var dataPath = Common.Paths.AwesomiumPath;
            dataPath.MakeSurePathExists();
            var cachePath = dataPath.GetChildDirectoryWithName("cache");
            cachePath.MakeSurePathExists();

            //CefBrowserProcessHandling.OnContextInitialized += WebCoreOnStarted;
            var cefSettings = new CefSettings {
                LogFile = Common.Paths.LogPath.GetChildFileWithName("cef.log").ToString(),
                UserDataPath = dataPath.ToString(),
                CachePath = cachePath.ToString() //,
                //PersistSessionCookies = true // flash but security hole..
#if DEBUG
                ,
                //RemoteDebuggingHost = "127.0.0.1",
                RemoteDebuggingPort = 6666
#endif
            };
            cefSettings.CefCommandLineArgs.Add("disable-gpu", "1");
            Cef.Initialize(cefSettings);
        }
        public MissionLibraryViewModel(MissionsViewModel missionsViewModel, IEventAggregator eventBus,
            UserSettings settings, IDialogManager dialogManager,
            Lazy<LaunchManager> launchManager,
            IUpdateManager updateManager, IContentManager contentList)
            : base(missionsViewModel) {
            SearchItem = new MissionSearchContentLibraryItemViewModel(this);
            _missionsViewModel = missionsViewModel;
            _missionList = contentList;
            _eventBus = eventBus;
            _settings = settings;
            _dialogManager = dialogManager;
            _launchManager = launchManager;
            _updateManager = updateManager;
            _contentList = contentList;

            Comparer = new ModSearchItemComparer();

            ViewType = settings.MissionOptions.ViewType;
            this.ObservableForProperty(x => x.ViewType)
                .Select(x => x.Value)
                .BindTo(settings, s => s.MissionOptions.ViewType);

            LocalMissionContextMenu = new LocalMissionFolderContextMenu(this);
        }
 public async Task SaveNow(UserSettings settings) {
     Contract.Requires<ArgumentNullException>(settings != null);
     await _cacheManager.Set(settings);
     await _cacheManager.Save();
 }
 public AuthProviderSettingsStorage(UserSettings settings) {
     _settings = settings;
 }
 public EvilGlobalSelectedGame(UserSettings settings) {
     _settings = settings;
 }