Пример #1
0
        public void AddDriver(InputDriver driver)
        {
            if (_driversList.Contains(driver))
            {
                throw new ArgumentException(driver.Name + " is already present.");
            }

            driver.InputReceived += InputHandler;
            _driversList.Add(driver);
        }
Пример #2
0
 public void RemoveDriver(InputDriver driver)
 {
     try
     {
         driver.InputReceived -= InputHandler;
         _driversList.Remove(driver);
     }
     catch
     {
         throw new ArgumentException(driver.Name + " driver is not present.");
     }
 }