StephaneLenclud@62: using System;
StephaneLenclud@62: using System.Collections.Generic;
StephaneLenclud@62: using System.Text;
StephaneLenclud@62:
StephaneLenclud@62: namespace Hid
StephaneLenclud@62: {
StephaneLenclud@62: static class Utils
StephaneLenclud@62: {
StephaneLenclud@62: ///
StephaneLenclud@62: /// Provide the type for the usage collection corresponding to the given usage page.
StephaneLenclud@62: ///
StephaneLenclud@62: ///
StephaneLenclud@62: ///
StephaneLenclud@62: public static Type UsageCollectionType(UsagePage aUsagePage)
StephaneLenclud@62: {
StephaneLenclud@62: switch (aUsagePage)
StephaneLenclud@62: {
StephaneLenclud@62: case UsagePage.GenericDesktopControls:
StephaneLenclud@66: return typeof(UsageCollection.GenericDesktop);
StephaneLenclud@62:
StephaneLenclud@62: case UsagePage.Consumer:
StephaneLenclud@66: return typeof(UsageCollection.Consumer);
StephaneLenclud@62:
StephaneLenclud@62: case UsagePage.WindowsMediaCenterRemoteControl:
StephaneLenclud@66: return typeof(UsageCollection.WindowsMediaCenter);
StephaneLenclud@62:
StephaneLenclud@62: default:
StephaneLenclud@62: return null;
StephaneLenclud@62: }
StephaneLenclud@62: }
StephaneLenclud@65:
StephaneLenclud@65: ///
StephaneLenclud@65: /// Provide the type for the usage corresponding to the given usage page.
StephaneLenclud@65: ///
StephaneLenclud@65: ///
StephaneLenclud@65: ///
StephaneLenclud@65: public static Type UsageType(UsagePage aUsagePage)
StephaneLenclud@65: {
StephaneLenclud@65: switch (aUsagePage)
StephaneLenclud@65: {
StephaneLenclud@65: case UsagePage.GenericDesktopControls:
StephaneLenclud@66: return typeof(Usage.GenericDesktop);
StephaneLenclud@65:
StephaneLenclud@65: case UsagePage.Consumer:
StephaneLenclud@66: return typeof(Usage.ConsumerControl);
StephaneLenclud@65:
StephaneLenclud@65: case UsagePage.WindowsMediaCenterRemoteControl:
StephaneLenclud@66: return typeof(Usage.WindowsMediaCenterRemoteControl);
StephaneLenclud@65:
StephaneLenclud@65: case UsagePage.Telephony:
StephaneLenclud@66: return typeof(Usage.TelephonyDevice);
StephaneLenclud@65:
StephaneLenclud@65: case UsagePage.SimulationControls:
StephaneLenclud@66: return typeof(Usage.SimulationControl);
StephaneLenclud@65:
StephaneLenclud@65: case UsagePage.GameControls:
StephaneLenclud@66: return typeof(Usage.GameControl);
StephaneLenclud@65:
StephaneLenclud@65: default:
StephaneLenclud@65: return null;
StephaneLenclud@65: }
StephaneLenclud@65: }
StephaneLenclud@65:
StephaneLenclud@62: }
StephaneLenclud@62: }