StephaneLenclud@76: //
StephaneLenclud@76: // Copyright (C) 2014-2015 Stéphane Lenclud.
StephaneLenclud@76: //
StephaneLenclud@76: // This file is part of SharpLibHid.
StephaneLenclud@76: //
StephaneLenclud@76: // SharpDisplayManager is free software: you can redistribute it and/or modify
StephaneLenclud@76: // it under the terms of the GNU General Public License as published by
StephaneLenclud@76: // the Free Software Foundation, either version 3 of the License, or
StephaneLenclud@76: // (at your option) any later version.
StephaneLenclud@76: //
StephaneLenclud@76: // SharpDisplayManager is distributed in the hope that it will be useful,
StephaneLenclud@76: // but WITHOUT ANY WARRANTY; without even the implied warranty of
StephaneLenclud@76: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
StephaneLenclud@76: // GNU General Public License for more details.
StephaneLenclud@76: //
StephaneLenclud@76: // You should have received a copy of the GNU General Public License
StephaneLenclud@76: // along with SharpDisplayManager. If not, see .
StephaneLenclud@76: //
StephaneLenclud@76:
StephaneLenclud@76: using System;
StephaneLenclud@62: using System.Collections.Generic;
StephaneLenclud@62: using System.Text;
StephaneLenclud@62:
StephaneLenclud@77: namespace SharpLib.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: }