public DeviceMapperProxy(IDeviceMapper deviceMapper, RetroPadMapping mapping)
 {
     _deviceMapper   = deviceMapper;
     _currentMapping = mapping;
     CreateInputList();
     if (deviceMapper.SupportsDeadZone)
     {
         SupportsDeadZone = true;
         CurrentDeadZone  = mapping.DeadZone;
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Arguments are injected from application module bindings
 /// </summary>
 /// <param name="deviceManager"></param>
 /// <param name="deviceMapper"></param>
 /// <param name="updateDeviceMapper"></param>
 public Form1(IDeviceManager deviceManager, IDeviceMapper deviceMapper, IUpdateDeviceMapper updateDeviceMapper)
 {
     timerTaskInterval          = Int32.Parse(ConfigurationManager.AppSettings["timerTaskInterval"]);
     _deviceManager             = deviceManager;
     _deviceMapper              = deviceMapper;
     _updateDeviceMapper        = updateDeviceMapper;
     oneMinuteEmulationInterval = Int32.Parse(ConfigurationManager.AppSettings["oneMinuteEmulationInterval"]);
     _emulationTimer            = new Timer {
         Enabled = false, Interval = timerTaskInterval
     };
     _emulationTimer.Tick += Tick;
     InitializeComponent();
 }
 protected void UpdateMappings()
 {
     ResetMapper();
     _inputList.Clear();
     if (_currentDevice != null)
     {
         IDeviceMapper   mapper  = _currentDevice.CreateMapper();
         RetroPadMapping mapping = _mappingProxy.GetDeviceMapping(_currentDevice);
         if (mapper != null && mapping != null)
         {
             DeviceMapperProxy deviceMapper = new DeviceMapperProxy(mapper, mapping);
             deviceMapper.SelectedInputProperty.Attach(OnSelectedInputChanged);
             CollectionUtils.AddAll(_inputList, deviceMapper.Inputs);
             DeviceMapper = deviceMapper;
         }
     }
     _inputList.FireChange();
 }
 public DeviceRepository(IDeviceMapper deviceMapper)
 {
     this.deviceMapper = deviceMapper;
 }
 public DeviceRepository(IDeviceMapper deviceMapper)
 {
     this.deviceMapper = deviceMapper;
 }