HidUtils.cs
author StephaneLenclud
Sun, 15 Feb 2015 20:28:46 +0100
changeset 62 bc92e2648220
child 65 09f1435bfb94
permissions -rw-r--r--
Device list now showing usage collection string.
StephaneLenclud@62
     1
using System;
StephaneLenclud@62
     2
using System.Collections.Generic;
StephaneLenclud@62
     3
using System.Text;
StephaneLenclud@62
     4
StephaneLenclud@62
     5
namespace Hid
StephaneLenclud@62
     6
{
StephaneLenclud@62
     7
    static class Utils
StephaneLenclud@62
     8
    {
StephaneLenclud@62
     9
        /// <summary>
StephaneLenclud@62
    10
        /// Provide the type for the usage collection corresponding to the given usage page.
StephaneLenclud@62
    11
        /// </summary>
StephaneLenclud@62
    12
        /// <param name="aUsagePage"></param>
StephaneLenclud@62
    13
        /// <returns></returns>
StephaneLenclud@62
    14
        public static Type UsageCollectionType(UsagePage aUsagePage)
StephaneLenclud@62
    15
        {
StephaneLenclud@62
    16
            switch (aUsagePage)
StephaneLenclud@62
    17
            {
StephaneLenclud@62
    18
                case UsagePage.GenericDesktopControls:
StephaneLenclud@62
    19
                    return typeof(UsageCollectionGenericDesktop);
StephaneLenclud@62
    20
StephaneLenclud@62
    21
                case UsagePage.Consumer:
StephaneLenclud@62
    22
                    return typeof(UsageCollectionConsumer);
StephaneLenclud@62
    23
StephaneLenclud@62
    24
                case UsagePage.WindowsMediaCenterRemoteControl:
StephaneLenclud@62
    25
                    return typeof(UsageCollectionWindowsMediaCenter);
StephaneLenclud@62
    26
StephaneLenclud@62
    27
                default:
StephaneLenclud@62
    28
                    return null;
StephaneLenclud@62
    29
            }
StephaneLenclud@62
    30
        }
StephaneLenclud@62
    31
    }
StephaneLenclud@62
    32
}