Example #1
0
        public static VirtualDevice CreateFromSettings(VirtualDeviceSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }
            VirtualDevice result;

            switch (settings.DeviceType)
            {
            case VirtualDeviceType.Keyboard:
                result = new VirtualKeyboard(settings.DeviceId);
                break;

            case VirtualDeviceType.TrackingInterface:
                result = new FreetrackInterface(settings.DeviceId);
                break;

            default:
                throw new NotImplementedException();
            }
            result.SendPolicy = settings.SendPolicy;
            result.SendRate   = settings.SendRate;
            return(result);
        }
Example #2
0
 public VirtualDeviceSettings(VirtualDeviceSettings settings)
 {
     if (settings == null)
     {
         throw new ArgumentNullException("settings");
     }
     this.DeviceId = settings.DeviceId;
     this.ClassifiedDeviceIndex = settings.ClassifiedDeviceIndex;
     this.DeviceType            = settings.DeviceType;
     this.SendPolicy            = settings.SendPolicy;
     this.SendRate = settings.SendRate;
     this.ButtonNo = settings.ButtonNo;
     this.AxisNo   = settings.AxisNo;
 }