Skip to content

Commit 96ca71e

Browse files
author
Brian Kendall
committed
Merge branch 'handle_devices_with_same_name'
2 parents b94eb56 + 7f98033 commit 96ca71e

21 files changed

Lines changed: 859 additions & 30 deletions

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
\#untracked/
3+
24
# Created by https://www.gitignore.io/api/visualstudio,windows
35

46
### Windows ###

DeviceLister/DeviceLister.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2013
4+
VisualStudioVersion = 12.0.31101.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeviceLister", "DeviceLister\DeviceLister.csproj", "{EBE0AF6C-E6DA-4497-843A-A3B2B16D2627}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{EBE0AF6C-E6DA-4497-843A-A3B2B16D2627}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{EBE0AF6C-E6DA-4497-843A-A3B2B16D2627}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{EBE0AF6C-E6DA-4497-843A-A3B2B16D2627}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{EBE0AF6C-E6DA-4497-843A-A3B2B16D2627}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
5+
<supportedRuntime version="v2.0.50727"/></startup>
6+
</configuration>
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{EBE0AF6C-E6DA-4497-843A-A3B2B16D2627}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>DeviceLister</RootNamespace>
11+
<AssemblyName>DeviceLister</AssemblyName>
12+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<PublishUrl>publish\</PublishUrl>
15+
<Install>true</Install>
16+
<InstallFrom>Disk</InstallFrom>
17+
<UpdateEnabled>false</UpdateEnabled>
18+
<UpdateMode>Foreground</UpdateMode>
19+
<UpdateInterval>7</UpdateInterval>
20+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
21+
<UpdatePeriodically>false</UpdatePeriodically>
22+
<UpdateRequired>false</UpdateRequired>
23+
<MapFileExtensions>true</MapFileExtensions>
24+
<ApplicationRevision>0</ApplicationRevision>
25+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
26+
<IsWebBootstrapper>false</IsWebBootstrapper>
27+
<UseApplicationTrust>false</UseApplicationTrust>
28+
<BootstrapperEnabled>true</BootstrapperEnabled>
29+
<TargetFrameworkProfile />
30+
</PropertyGroup>
31+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
32+
<PlatformTarget>AnyCPU</PlatformTarget>
33+
<DebugSymbols>true</DebugSymbols>
34+
<DebugType>full</DebugType>
35+
<Optimize>false</Optimize>
36+
<OutputPath>bin\Debug\</OutputPath>
37+
<DefineConstants>DEBUG;TRACE</DefineConstants>
38+
<ErrorReport>prompt</ErrorReport>
39+
<WarningLevel>4</WarningLevel>
40+
</PropertyGroup>
41+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
42+
<PlatformTarget>x86</PlatformTarget>
43+
<DebugType>pdbonly</DebugType>
44+
<Optimize>true</Optimize>
45+
<OutputPath>bin\Release\</OutputPath>
46+
<DefineConstants>TRACE</DefineConstants>
47+
<ErrorReport>prompt</ErrorReport>
48+
<WarningLevel>4</WarningLevel>
49+
</PropertyGroup>
50+
<ItemGroup>
51+
<Reference Include="Microsoft.DirectX.DirectInput, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
52+
<SpecificVersion>False</SpecificVersion>
53+
<HintPath>..\..\..\..\Windows\Microsoft.NET\DirectX for Managed Code\1.0.2902.0\Microsoft.DirectX.DirectInput.dll</HintPath>
54+
</Reference>
55+
<Reference Include="System" />
56+
<Reference Include="System.Core" />
57+
<Reference Include="System.Xml.Linq" />
58+
<Reference Include="System.Data.DataSetExtensions" />
59+
<Reference Include="Microsoft.CSharp" />
60+
<Reference Include="System.Data" />
61+
<Reference Include="System.Deployment" />
62+
<Reference Include="System.Drawing" />
63+
<Reference Include="System.Windows.Forms" />
64+
<Reference Include="System.Xml" />
65+
</ItemGroup>
66+
<ItemGroup>
67+
<Compile Include="DeviceListerForm.cs">
68+
<SubType>Form</SubType>
69+
</Compile>
70+
<Compile Include="DeviceListerForm.Designer.cs">
71+
<DependentUpon>DeviceListerForm.cs</DependentUpon>
72+
</Compile>
73+
<Compile Include="Program.cs" />
74+
<Compile Include="Properties\AssemblyInfo.cs" />
75+
<EmbeddedResource Include="DeviceListerForm.resx">
76+
<DependentUpon>DeviceListerForm.cs</DependentUpon>
77+
</EmbeddedResource>
78+
<EmbeddedResource Include="Properties\Resources.resx">
79+
<Generator>ResXFileCodeGenerator</Generator>
80+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
81+
<SubType>Designer</SubType>
82+
</EmbeddedResource>
83+
<Compile Include="Properties\Resources.Designer.cs">
84+
<AutoGen>True</AutoGen>
85+
<DependentUpon>Resources.resx</DependentUpon>
86+
<DesignTime>True</DesignTime>
87+
</Compile>
88+
<None Include="Properties\Settings.settings">
89+
<Generator>SettingsSingleFileGenerator</Generator>
90+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
91+
</None>
92+
<Compile Include="Properties\Settings.Designer.cs">
93+
<AutoGen>True</AutoGen>
94+
<DependentUpon>Settings.settings</DependentUpon>
95+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
96+
</Compile>
97+
</ItemGroup>
98+
<ItemGroup>
99+
<None Include="App.config">
100+
<SubType>Designer</SubType>
101+
</None>
102+
</ItemGroup>
103+
<ItemGroup>
104+
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
105+
<Visible>False</Visible>
106+
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
107+
<Install>true</Install>
108+
</BootstrapperPackage>
109+
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
110+
<Visible>False</Visible>
111+
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
112+
<Install>false</Install>
113+
</BootstrapperPackage>
114+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
115+
<Visible>False</Visible>
116+
<ProductName>.NET Framework 3.5 SP1</ProductName>
117+
<Install>false</Install>
118+
</BootstrapperPackage>
119+
</ItemGroup>
120+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
121+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
122+
Other similar extension points exist, see Microsoft.Common.targets.
123+
<Target Name="BeforeBuild">
124+
</Target>
125+
<Target Name="AfterBuild">
126+
</Target>
127+
-->
128+
</Project>

DeviceLister/DeviceLister/DeviceListerForm.Designer.cs

Lines changed: 79 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Data;
5+
using System.Drawing;
6+
using System.Linq;
7+
using System.Text;
8+
using System.Windows.Forms;
9+
using Microsoft.DirectX.DirectInput;
10+
11+
namespace DeviceLister
12+
{
13+
public partial class DeviceListerForm : Form
14+
{
15+
public DeviceListerForm()
16+
{
17+
InitializeComponent();
18+
}
19+
20+
private void DeviceListerForm_Load(object sender, EventArgs e)
21+
{
22+
string deviceData = "";
23+
24+
foreach (DeviceInstance di in Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly))
25+
{
26+
deviceData += "\"" + di.ProductName + "\": {" + di.InstanceGuid + "}" + System.Environment.NewLine;
27+
}
28+
29+
textBox.Text = deviceData;
30+
textBox.Select(0, 0);
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)