Ejemplo n.º 1
0
        public ZGameFactory(IZConnection connection)
        {
            _installedGamesService = new ZInstalledGamesService();
            _connection            = connection;

            _loadRunJSON();
        }
Ejemplo n.º 2
0
        public MainWindowViewModel(
            IZApi api,
            ILog logger,
            ISettingsService settingsService,
            IProcessService processService,
            IResolutionRoot kernel,
            IEventService eventService,
            IMainMenuService menuService,
            IUpdateService updateService,
            IGameService gameService,
            IDiscord discordPresence,

            IPageNavigator navigator,
            IApplicationState state,
            IViewModelSource viewModelSource,
            IDialogService dialogService,
            IDialogSystemBase dialogSystemBase,
            IBusyIndicatorBase busyIndicatorBase,
            IBusyIndicatorService busyIndicatorService)
        {
            _navigator            = navigator;
            _state                = state;
            _dialogSystemBase     = dialogSystemBase;
            _dialogService        = dialogService;
            _busyIndicatorBase    = busyIndicatorBase;
            _busyIndicatorService = busyIndicatorService;
            _eventService         = eventService;

            _menuService = menuService;

            _apiConnection   = api.Connection;
            _log             = logger;
            _settingsService = settingsService;
            _processService  = processService;
            _updateService   = updateService;
            _gameService     = gameService;
            _discordPresence = discordPresence;
            _api             = api;

            NonClientDataContext = viewModelSource.Create <WindowNonClientPartViewModel>();
            BottomBarDataContext = viewModelSource.Create <WindowBottomBarPartViewModel>();

            _apiConnection.ConnectionChanged += _apiConnectionConnectionChangedHandler;

            _zClientProcessTracker = new ZProcessTracker(_ZClientProcessName, TimeSpan.FromSeconds(3), true, processes => processes
                                                         .OrderByDescending(process => process.StartTime)
                                                         .First());
            _zClientProcessTracker.ProcessDetected += _zClientProcessDetectedHandler;
            _zClientProcessTracker.ProcessLost     += _zClientProcessLostHandler;

            api.Configure(new ZConfiguration {
                SynchronizationContext = SynchronizationContext.Current
            });

            _gameService.GameCreationError += _GameCreationErrorHandler;
        }
Ejemplo n.º 3
0
        private ZApi()
        {
            // creating a client services
            _connection   = new ZConnection();
            _statsService = new ZStatsService();
            _gameFactory  = new ZGameFactory(_connection);
            _injector     = new ZInjectorService();

            // initializing the static helpers
            ZConnectionHelper.Initialize(_connection);
        }
Ejemplo n.º 4
0
 internal static void Initialize(IZConnection connection) => _connection = connection;