author | StephaneLenclud |
Tue, 17 Mar 2015 15:35:58 +0100 | |
changeset 83 | 2d5955694057 |
parent 77 | fb9ea5ad8c2d |
permissions | -rw-r--r-- |
StephaneLenclud@76 | 1 |
// |
StephaneLenclud@76 | 2 |
// Copyright (C) 2014-2015 Stéphane Lenclud. |
StephaneLenclud@76 | 3 |
// |
StephaneLenclud@76 | 4 |
// This file is part of SharpLibHid. |
StephaneLenclud@76 | 5 |
// |
StephaneLenclud@76 | 6 |
// SharpDisplayManager is free software: you can redistribute it and/or modify |
StephaneLenclud@76 | 7 |
// it under the terms of the GNU General Public License as published by |
StephaneLenclud@76 | 8 |
// the Free Software Foundation, either version 3 of the License, or |
StephaneLenclud@76 | 9 |
// (at your option) any later version. |
StephaneLenclud@76 | 10 |
// |
StephaneLenclud@76 | 11 |
// SharpDisplayManager is distributed in the hope that it will be useful, |
StephaneLenclud@76 | 12 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
StephaneLenclud@76 | 13 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
StephaneLenclud@76 | 14 |
// GNU General Public License for more details. |
StephaneLenclud@76 | 15 |
// |
StephaneLenclud@76 | 16 |
// You should have received a copy of the GNU General Public License |
StephaneLenclud@76 | 17 |
// along with SharpDisplayManager. If not, see <http://www.gnu.org/licenses/>. |
StephaneLenclud@76 | 18 |
// |
StephaneLenclud@76 | 19 |
|
StephaneLenclud@76 | 20 |
using System; |
StephaneLenclud@62 | 21 |
using System.Collections.Generic; |
StephaneLenclud@62 | 22 |
using System.Text; |
StephaneLenclud@62 | 23 |
|
StephaneLenclud@77 | 24 |
namespace SharpLib.Hid |
StephaneLenclud@62 | 25 |
{ |
StephaneLenclud@62 | 26 |
static class Utils |
StephaneLenclud@62 | 27 |
{ |
StephaneLenclud@62 | 28 |
/// <summary> |
StephaneLenclud@62 | 29 |
/// Provide the type for the usage collection corresponding to the given usage page. |
StephaneLenclud@62 | 30 |
/// </summary> |
StephaneLenclud@62 | 31 |
/// <param name="aUsagePage"></param> |
StephaneLenclud@62 | 32 |
/// <returns></returns> |
StephaneLenclud@62 | 33 |
public static Type UsageCollectionType(UsagePage aUsagePage) |
StephaneLenclud@62 | 34 |
{ |
StephaneLenclud@62 | 35 |
switch (aUsagePage) |
StephaneLenclud@62 | 36 |
{ |
StephaneLenclud@62 | 37 |
case UsagePage.GenericDesktopControls: |
StephaneLenclud@66 | 38 |
return typeof(UsageCollection.GenericDesktop); |
StephaneLenclud@62 | 39 |
|
StephaneLenclud@62 | 40 |
case UsagePage.Consumer: |
StephaneLenclud@66 | 41 |
return typeof(UsageCollection.Consumer); |
StephaneLenclud@62 | 42 |
|
StephaneLenclud@62 | 43 |
case UsagePage.WindowsMediaCenterRemoteControl: |
StephaneLenclud@66 | 44 |
return typeof(UsageCollection.WindowsMediaCenter); |
StephaneLenclud@62 | 45 |
|
StephaneLenclud@62 | 46 |
default: |
StephaneLenclud@62 | 47 |
return null; |
StephaneLenclud@62 | 48 |
} |
StephaneLenclud@62 | 49 |
} |
StephaneLenclud@65 | 50 |
|
StephaneLenclud@65 | 51 |
/// <summary> |
StephaneLenclud@65 | 52 |
/// Provide the type for the usage corresponding to the given usage page. |
StephaneLenclud@65 | 53 |
/// </summary> |
StephaneLenclud@65 | 54 |
/// <param name="aUsagePage"></param> |
StephaneLenclud@65 | 55 |
/// <returns></returns> |
StephaneLenclud@65 | 56 |
public static Type UsageType(UsagePage aUsagePage) |
StephaneLenclud@65 | 57 |
{ |
StephaneLenclud@65 | 58 |
switch (aUsagePage) |
StephaneLenclud@65 | 59 |
{ |
StephaneLenclud@65 | 60 |
case UsagePage.GenericDesktopControls: |
StephaneLenclud@66 | 61 |
return typeof(Usage.GenericDesktop); |
StephaneLenclud@65 | 62 |
|
StephaneLenclud@65 | 63 |
case UsagePage.Consumer: |
StephaneLenclud@66 | 64 |
return typeof(Usage.ConsumerControl); |
StephaneLenclud@65 | 65 |
|
StephaneLenclud@65 | 66 |
case UsagePage.WindowsMediaCenterRemoteControl: |
StephaneLenclud@66 | 67 |
return typeof(Usage.WindowsMediaCenterRemoteControl); |
StephaneLenclud@65 | 68 |
|
StephaneLenclud@65 | 69 |
case UsagePage.Telephony: |
StephaneLenclud@66 | 70 |
return typeof(Usage.TelephonyDevice); |
StephaneLenclud@65 | 71 |
|
StephaneLenclud@65 | 72 |
case UsagePage.SimulationControls: |
StephaneLenclud@66 | 73 |
return typeof(Usage.SimulationControl); |
StephaneLenclud@65 | 74 |
|
StephaneLenclud@65 | 75 |
case UsagePage.GameControls: |
StephaneLenclud@66 | 76 |
return typeof(Usage.GameControl); |
StephaneLenclud@65 | 77 |
|
StephaneLenclud@65 | 78 |
default: |
StephaneLenclud@65 | 79 |
return null; |
StephaneLenclud@65 | 80 |
} |
StephaneLenclud@65 | 81 |
} |
StephaneLenclud@65 | 82 |
|
StephaneLenclud@62 | 83 |
} |
StephaneLenclud@62 | 84 |
} |