예제 #1
0
        public SanctuaryGame(IContentChest contentChest, IViewManager viewManager, IApplicationFolder applicationFolder,
                             IKeyboardDispatcher keyboardDispatcher, IMouseManager mouseManager, Cursor cursor,
                             IOptionsManager optionsManager)
        {
            _contentChest       = contentChest;
            _viewManager        = viewManager;
            _applicationFolder  = applicationFolder;
            _keyboardDispatcher = keyboardDispatcher;
            _mouseManager       = mouseManager;
            _cursor             = cursor;
            _optionsManager     = optionsManager;

            _graphics = new GraphicsDeviceManager(this)
            {
                PreferredBackBufferWidth  = 1280,
                PreferredBackBufferHeight = 720
            };

            Window.AllowUserResizing  = true;
            Window.ClientSizeChanged += WindowOnClientSizeChanged;

            IsMouseVisible = false;
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            _viewManager.Graphics = _graphics;
            //InitializeSteam();
        }
예제 #2
0
 public ContinuousConfigurator(
     IOptionsManager optionsManager,
     IFactory <WhiteCache> whiteCacheFactory,
     IRootFactory <ContinuousConfiguration> continuousConfigurationFactory)
 {
     _optionsManager    = optionsManager;
     _whiteCacheFactory = whiteCacheFactory;
     _continuousConfigurationFactory = continuousConfigurationFactory;
 }
 public ContinuousConfigurator(
     IOptionsManager optionsManager,
     IFactory<WhiteCache> whiteCacheFactory,
     IRootFactory<ContinuousConfiguration> continuousConfigurationFactory)
 {
     _optionsManager = optionsManager;
     _whiteCacheFactory = whiteCacheFactory;
     _continuousConfigurationFactory = continuousConfigurationFactory;
 }
예제 #4
0
        public void Construct(IOptionsManager optionsManager)
        {
            OptionsManager = optionsManager;

            OptionsManager.OptionsLoaded += OnOptionsLoaded;

            //If no option yet, set default value according to toggle, and save
            OptionsManager.Ready += ListenReady;
        }
예제 #5
0
        public CustomApplicationContext(IGitUserManager gitUserManager, IOptionsManager optionsManager, IIconRepository iconRepository, IProcessKiller processKiller)
        {
            this.gitUserManager = gitUserManager;
            this.optionsManager = optionsManager;
            this.iconRepository = iconRepository;
            this.processKiller  = processKiller;

            InitializeTrayIcon();
        }
예제 #6
0
        public GitUserManager(IOptionsManager optionsManager, IFileHandler fileHandler, IFileHasher fileHasher, IGitConfigEditor gitConfigEditor, ISshConfigEditor sshConfigEditor)
        {
            this.optionsManager  = optionsManager;
            this.fileHandler     = fileHandler;
            this.fileHasher      = fileHasher;
            this.gitConfigEditor = gitConfigEditor;
            this.sshConfigEditor = sshConfigEditor;

            availableUsers = new List <GitUser>();
            activeUsers    = new List <GitUser>();
        }
예제 #7
0
        public OptionsController(
            OptionsViewModel viewModel,
            CommonServices svc,
            IOptionsManager optionsManager)
        {
            _viewModel      = viewModel;
            _svc            = svc;
            _optionsManager = optionsManager;

            _viewModel.CommandSave  = new SmartCommand(SaveResults);
            _viewModel.CommandClose = new SmartCommand(Close);
        }
예제 #8
0
        public OptionsController(
            OptionsViewModel viewModel, 
            CommonServices svc,
            IOptionsManager optionsManager)
        {
            _viewModel = viewModel;
            _svc = svc;
            _optionsManager = optionsManager;

            _viewModel.CommandSave = new SmartCommand(SaveResults);
            _viewModel.CommandClose = new SmartCommand(Close);
        }
예제 #9
0
        public void Construct(
            GameManager gameManager,
            GameData gameData,
            IOptionsManager optionsManager,
            Camera playerCamera,
            [Inject(Id = "GameCamera")] CinemachineVirtualCamera playerGameCamera)
        {
            _gameManager = gameManager;
            _gameData    = gameData;

            _optionsManager = optionsManager;

            _playerCamera     = playerCamera;
            _playerGameCamera = playerGameCamera;
        }
예제 #10
0
        public ApplicationController(
            IBindingFactory <MainController> mainControllerFactory,
            IOptionsManager optionsManager,
            IHostEnviromentConnection hostEnviroment,
            ISettingsManager settingsManager,
            IEventService eventService)
        {
            _optionsManager  = optionsManager;
            _hostEnviroment  = hostEnviroment;
            _settingsManager = settingsManager;
            _eventService    = eventService;

            HookGlobalExceptionHandlers();

            _eventService.Subscribe(this);

            _mainController = mainControllerFactory.CreateWithBindings(_hostEnviroment.Events);
        }
        public ApplicationController(
            IBindingFactory<MainController> mainControllerFactory,
            IOptionsManager optionsManager,
            IHostEnviromentConnection hostEnviroment,
            ISettingsManager settingsManager,
            IEventService eventService)
        {
            _optionsManager = optionsManager;
            _hostEnviroment = hostEnviroment;
            _settingsManager = settingsManager;
            _eventService = eventService;

            HookGlobalExceptionHandlers();

            _eventService.Subscribe(this);

            _mainController = mainControllerFactory.CreateWithBindings(_hostEnviroment.Events);
        }
 public CharacterCreationMenu(IContentChest contentChest, IPlayerMaker playerMaker,
                              IViewPortManager viewPortManager, IKeyboardDispatcher keyboardDispatcher, IUserInterface userInterface,
                              IOptionsManager optionsManager, IContentLoader <IReadOnlyCollection <Hair> > hairContentLoader,
                              IContentLoader <IReadOnlyCollection <Head> > headContentLoader,
                              IContentLoader <IReadOnlyCollection <Eyes> > eyeContentLoader,
                              IContentLoader <AsepriteSpriteMap> spriteMapLoader,
                              ICharacterRenderer characterRenderer)
 {
     _contentChest        = contentChest;
     _playerMaker         = playerMaker;
     _viewPortPortManager = viewPortManager;
     _keyboardDispatcher  = keyboardDispatcher;
     _userInterface       = userInterface;
     _optionsManager      = optionsManager;
     _hairContentLoader   = hairContentLoader;
     _headContentLoader   = headContentLoader;
     _eyeContentLoader    = eyeContentLoader;
     _spriteMapLoader     = spriteMapLoader;
     _characterRenderer   = characterRenderer;
 }
예제 #13
0
 public HostImpl(ICommandManager commands, IOptionsManager options)
 {
     this.commands = commands;
     this.options = options;
 }
예제 #14
0
        public MainController(
            IObservable<EventType> environmentEvents1,
            IFactory<OptionsController> optionsController,
            MainViewModel viewModel,
            ContinuousConfigurator continuousConfigurator,
            IOptionsManager optionsManager,
            IHostEnviromentConnection host,
            CommonServices svc)
        {
            _optionsController = optionsController;
            _viewModel = viewModel;
            _continuousConfigurator = continuousConfigurator;
            _optionsManager = optionsManager;
            _host = host;
            _sessionFinished = new Subject<string>();
            _controlSource = new Subject<ControlEvent>();
            _svc = svc;

            _viewModel.CommandCreateNewMutants = new SmartCommand(() => RunMutationSession(),
                () => _viewModel.OperationsState.IsIn(OperationsState.None, OperationsState.Finished, OperationsState.Error))
                .UpdateOnChanged(_viewModel, () => _viewModel.OperationsState);

            _viewModel.CommandPause = new SmartCommand(PauseOperations, 
                () => _viewModel.OperationsState.IsIn(OperationsState.Testing))
                .UpdateOnChanged(_viewModel, () => _viewModel.OperationsState);

            _viewModel.CommandStop = new SmartCommand(StopOperations,
                () => _viewModel.OperationsState.IsIn(OperationsState.Mutating, OperationsState.PreCheck,
                    OperationsState.Testing, OperationsState.TestingPaused, OperationsState.Pausing))
                .UpdateOnChanged(_viewModel, () => _viewModel.OperationsState);

            _viewModel.CommandContinue = new SmartCommand(ResumeOperations,
                () => _viewModel.OperationsState == OperationsState.TestingPaused)
                .UpdateOnChanged(_viewModel, () => _viewModel.OperationsState);

            _viewModel.CommandSaveResults = new SmartCommand(SaveResults, () =>
                _viewModel.OperationsState == OperationsState.Finished)
                .UpdateOnChanged(_viewModel, () => _viewModel.OperationsState);

            _viewModel.CommandOptions = new SmartCommand(() => ShowOptions(),
                () => _viewModel.OperationsState.IsIn(OperationsState.None, OperationsState.Finished, OperationsState.Error))
                .UpdateOnChanged(_viewModel, () => _viewModel.OperationsState);
            _viewModel.CommandTest = new SmartCommand(Test);


            _disp = new List<IDisposable>
                    {
                        environmentEvents1
                            .Where(e => e == EventType.HostOpened)
                            .Subscribe(type =>
                            {
                                Initialize();
                                continuousConfigurator.CreateConfiguration();
                            }),
                        environmentEvents1
                            .Where(e => e == EventType.HostClosed)
                            .Subscribe(type =>
                            {
                                continuousConfigurator.DisposeConfiguration();
                                Deactivate();
                            }),
                        environmentEvents1
                            .Where(e => e == EventType.BuildBegin)
                            .Subscribe(type => continuousConfigurator.DisposeConfiguration()),

                        environmentEvents1
                            .Where(e => e == EventType.BuildDone)
                            .Subscribe(type => continuousConfigurator.CreateConfiguration()),

                        _optionsManager.Events
                            .Where(e => e == OptionsManager.EventType.Updated)
                            .Subscribe(t =>
                            {
                                continuousConfigurator.DisposeConfiguration();
                                continuousConfigurator.CreateConfiguration();
                            }),
                    };

        }
예제 #15
0
 public App(IOptionsManager<DemoOptions> options, IConfiguration configuration, ITenantService tenantService) {
     _options = options;
     _configuration = configuration;
     _tenantService = tenantService;
 }
 public LiveUpdateableOptionsWrapper(IOptionsManager configurationManager)
 {
     this.configurationManager = configurationManager.ThrowIfNull(nameof(configurationManager));
 }
 public UpdateableOptionsWrapper(IOptionsManager configurationManager, T options)
 {
     this.configurationManager = configurationManager.ThrowIfNull(nameof(configurationManager));
     this.Value = options;
 }
예제 #18
0
 public HomeController(ILogger <HomeController> logger, IHttpContextAccessor httpContextAccessor, IOptionsManager <DemoOptions> options)
 {
     _logger = logger;
     _httpContextAccessor = httpContextAccessor;
     _options             = options;
 }
예제 #19
0
파일: Host.cs 프로젝트: gitter-badger/clide
 public HostImpl(ICommandManager commands, IOptionsManager options)
 {
     this.commands = commands;
     this.options  = options;
 }
예제 #20
0
        public MainController(
            IObservable <EventType> environmentEvents1,
            IFactory <OptionsController> optionsController,
            MainViewModel viewModel,
            ContinuousConfigurator continuousConfigurator,
            IOptionsManager optionsManager,
            IHostEnviromentConnection host,
            CommonServices svc)
        {
            _optionsController      = optionsController;
            _viewModel              = viewModel;
            _continuousConfigurator = continuousConfigurator;
            _optionsManager         = optionsManager;
            _host            = host;
            _sessionFinished = new Subject <string>();
            _controlSource   = new Subject <ControlEvent>();
            _svc             = svc;

            _viewModel.CommandCreateNewMutants = new SmartCommand(() => RunMutationSession(),
                                                                  () => _viewModel.OperationsState.IsIn(OperationsState.None, OperationsState.Finished, OperationsState.Error))
                                                 .UpdateOnChanged(_viewModel, () => _viewModel.OperationsState);

            _viewModel.CommandPause = new SmartCommand(PauseOperations,
                                                       () => _viewModel.OperationsState.IsIn(OperationsState.Testing))
                                      .UpdateOnChanged(_viewModel, () => _viewModel.OperationsState);

            _viewModel.CommandStop = new SmartCommand(StopOperations,
                                                      () => _viewModel.OperationsState.IsIn(OperationsState.Mutating, OperationsState.PreCheck,
                                                                                            OperationsState.Testing, OperationsState.TestingPaused, OperationsState.Pausing))
                                     .UpdateOnChanged(_viewModel, () => _viewModel.OperationsState);

            _viewModel.CommandContinue = new SmartCommand(ResumeOperations,
                                                          () => _viewModel.OperationsState == OperationsState.TestingPaused)
                                         .UpdateOnChanged(_viewModel, () => _viewModel.OperationsState);

            _viewModel.CommandSaveResults = new SmartCommand(SaveResults, () =>
                                                             _viewModel.OperationsState == OperationsState.Finished)
                                            .UpdateOnChanged(_viewModel, () => _viewModel.OperationsState);

            _viewModel.CommandOptions = new SmartCommand(() => ShowOptions(),
                                                         () => _viewModel.OperationsState.IsIn(OperationsState.None, OperationsState.Finished, OperationsState.Error))
                                        .UpdateOnChanged(_viewModel, () => _viewModel.OperationsState);
            _viewModel.CommandTest = new SmartCommand(Test);

            _disp = new List <IDisposable>
            {
                environmentEvents1
                .Where(e => e == EventType.HostOpened)
                .Subscribe(type =>
                {
                    Initialize();
                    continuousConfigurator.CreateConfiguration();
                }),
                environmentEvents1
                .Where(e => e == EventType.HostClosed)
                .Subscribe(type =>
                {
                    continuousConfigurator.DisposeConfiguration();
                    Deactivate();
                }),
                environmentEvents1
                .Where(e => e == EventType.BuildBegin)
                .Subscribe(type => continuousConfigurator.DisposeConfiguration()),

                environmentEvents1
                .Where(e => e == EventType.BuildDone)
                .Subscribe(type => continuousConfigurator.CreateConfiguration()),

                _optionsManager.Events
                .Where(e => e == OptionsManager.EventType.Updated)
                .Subscribe(t =>
                {
                    continuousConfigurator.DisposeConfiguration();
                    continuousConfigurator.CreateConfiguration();
                }),
            };
        }