mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-11 15:59:08 +01:00
This build adds a few more devs to the about page, and if you don't have the Virtual Bus Driver installed, DS4Windows will walk you through installing the driver. And since I love images, here's the installer window.
This makes it easier to distribute a single zip and not have multiple exe’s in it. I know there’s the Updater.exe, but if it’s deleted, it will now be redownloaded. This way I can just put one executable in the zip, so casual users don’t get confused. If Virtual Bus is installed via DS4Windows, there is an uninstall link in about.
This commit is contained in:
parent
67bf8b061c
commit
008f549d22
@ -82,8 +82,7 @@ namespace DS4Control
|
||||
device.Report += this.On_Report;
|
||||
//m_switcher.setMode(Global.getInitialMode(ind));
|
||||
TouchPadOn(ind, device);
|
||||
string[] profileA = Global.getAProfile(ind).Split('\\');
|
||||
string filename = profileA[profileA.Length - 1];
|
||||
string filename = Path.GetFileName(Global.getAProfile(ind));
|
||||
ind++;
|
||||
if (System.IO.File.Exists(Global.appdatapath + "\\Profiles\\" + filename))
|
||||
{
|
||||
@ -92,8 +91,8 @@ namespace DS4Control
|
||||
}
|
||||
else
|
||||
{
|
||||
LogDebug("Controller " + ind + " is using a profile not found");
|
||||
Log.LogToTray("Controller " + ind + " is using a profile not found");
|
||||
LogDebug("Controller " + ind + " is not using a profile");
|
||||
Log.LogToTray("Controller " + ind + " is not using a profile");
|
||||
}
|
||||
if (ind >= 4) // out of Xinput devices!
|
||||
break;
|
||||
@ -173,17 +172,16 @@ namespace DS4Control
|
||||
device.Report += this.On_Report;
|
||||
x360Bus.Plugin(Index);
|
||||
TouchPadOn(Index, device);
|
||||
string[] profileA = Global.getAProfile(Index).Split('\\');
|
||||
string filename = profileA[profileA.Length - 1];
|
||||
string filename = Path.GetFileName(Global.getAProfile(Index));
|
||||
if (System.IO.File.Exists(Global.appdatapath + "\\Profiles\\" + filename))
|
||||
{
|
||||
LogDebug("Controller " + (Index+1) + " is using Profile \"" + filename.Substring(0, filename.Length - 4) + "\"");
|
||||
LogDebug("Controller " + (Index + 1) + " is using Profile \"" + filename.Substring(0, filename.Length - 4) + "\"");
|
||||
Log.LogToTray("Controller " + (Index + 1) + " is using Profile \"" + filename.Substring(0, filename.Length - 4) + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
LogDebug("Controller " + (Index + 1) + " is using a profile not found");
|
||||
Log.LogToTray("Controller " + (Index + 1) + " is using a profile not found");
|
||||
LogDebug("Controller " + (Index + 1) + " is not using a profile");
|
||||
Log.LogToTray("Controller " + (Index + 1) + " is not using a profile");
|
||||
}
|
||||
|
||||
break;
|
||||
@ -404,7 +402,7 @@ namespace DS4Control
|
||||
|
||||
public virtual void LogDebug(String Data)
|
||||
{
|
||||
Console.WriteLine(System.DateTime.UtcNow.ToString("o") + "> " + Data);
|
||||
Console.WriteLine(System.DateTime.Now.ToString("G") + "> " + Data);
|
||||
if (Debug != null)
|
||||
{
|
||||
DebugEventArgs args = new DebugEventArgs(Data);
|
||||
|
@ -9,7 +9,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ScpServer</RootNamespace>
|
||||
<AssemblyName>DS4Tool</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<IsWebBootstrapper>true</IsWebBootstrapper>
|
||||
<PublishUrl>C:\Users\Jonathan\Dropbox\Public\DS4 Tool\</PublishUrl>
|
||||
@ -31,6 +31,7 @@
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
@ -41,6 +42,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>3</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
@ -50,6 +52,7 @@
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Resources\DS4.ico</ApplicationIcon>
|
||||
@ -73,6 +76,9 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.IO.Compression.FileSystem" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@ -116,6 +122,12 @@
|
||||
<DependentUpon>ScpForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Settings.cs" />
|
||||
<Compile Include="WelcomeDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WelcomeDialog.Designer.cs">
|
||||
<DependentUpon>WelcomeDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Hotkeys.resx">
|
||||
<DependentUpon>Hotkeys.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@ -133,6 +145,10 @@
|
||||
<EmbeddedResource Include="ScpForm.resx">
|
||||
<DependentUpon>ScpForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="WelcomeDialog.resx">
|
||||
<DependentUpon>WelcomeDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<None Include="app.config" />
|
||||
<None Include="DS4Tool_TemporaryKey.pfx" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
@ -169,6 +185,7 @@
|
||||
<None Include="Resources\LeftTouch.png" />
|
||||
<None Include="Resources\MultiTouch.png" />
|
||||
<None Include="Resources\RightTouch.png" />
|
||||
<None Include="Resources\Pairmode.png" />
|
||||
<Content Include="Resources\Scp_All.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
123
DS4Tool/Hotkeys.Designer.cs
generated
123
DS4Tool/Hotkeys.Designer.cs
generated
@ -41,10 +41,13 @@
|
||||
this.label14 = new System.Windows.Forms.Label();
|
||||
this.label15 = new System.Windows.Forms.Label();
|
||||
this.linkProfiles = new System.Windows.Forms.LinkLabel();
|
||||
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
|
||||
this.linkLabel2 = new System.Windows.Forms.LinkLabel();
|
||||
this.linkElectro = new System.Windows.Forms.LinkLabel();
|
||||
this.linkJays2Kings = new System.Windows.Forms.LinkLabel();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.lbAbout = new System.Windows.Forms.Label();
|
||||
this.linkInhexSTER = new System.Windows.Forms.LinkLabel();
|
||||
this.linkJhebbel = new System.Windows.Forms.LinkLabel();
|
||||
this.linkUninstall = new System.Windows.Forms.LinkLabel();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
@ -61,18 +64,18 @@
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(26, 111);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(108, 13);
|
||||
this.label3.Size = new System.Drawing.Size(176, 13);
|
||||
this.label3.TabIndex = 2;
|
||||
this.label3.Text = "Pad click (if tap is on)";
|
||||
this.label3.Text = "Tap then hold touchpad (if enabled)";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(26, 136);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(166, 13);
|
||||
this.label4.Size = new System.Drawing.Size(172, 13);
|
||||
this.label4.TabIndex = 3;
|
||||
this.label4.Text = "Pad click on lower right if enabled";
|
||||
this.label4.Text = "Pad click on lower right (if enabled)";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
@ -88,23 +91,23 @@
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(226, 111);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(50, 13);
|
||||
this.label7.Size = new System.Drawing.Size(83, 13);
|
||||
this.label7.TabIndex = 6;
|
||||
this.label7.Text = "Left click";
|
||||
this.label7.Text = "Left mouse drag";
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(226, 136);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(145, 26);
|
||||
this.label8.Size = new System.Drawing.Size(165, 26);
|
||||
this.label8.TabIndex = 7;
|
||||
this.label8.Text = "Right click (Best used when \r\nright side is used as a mouse)";
|
||||
this.label8.Text = "Right click (Best used when right \r\nside is used as a mouse button)";
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.button1.Location = new System.Drawing.Point(163, 217);
|
||||
this.button1.Location = new System.Drawing.Point(163, 275);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 8;
|
||||
@ -161,7 +164,7 @@
|
||||
//
|
||||
this.linkProfiles.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.linkProfiles.AutoSize = true;
|
||||
this.linkProfiles.Location = new System.Drawing.Point(292, 222);
|
||||
this.linkProfiles.Location = new System.Drawing.Point(292, 280);
|
||||
this.linkProfiles.Name = "linkProfiles";
|
||||
this.linkProfiles.Size = new System.Drawing.Size(94, 13);
|
||||
this.linkProfiles.TabIndex = 17;
|
||||
@ -169,36 +172,36 @@
|
||||
this.linkProfiles.Text = "Open Profile folder";
|
||||
this.linkProfiles.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkProfiles_LinkClicked);
|
||||
//
|
||||
// linkLabel1
|
||||
// linkElectro
|
||||
//
|
||||
this.linkLabel1.AutoSize = true;
|
||||
this.linkLabel1.Location = new System.Drawing.Point(215, 194);
|
||||
this.linkLabel1.Name = "linkLabel1";
|
||||
this.linkLabel1.Size = new System.Drawing.Size(143, 13);
|
||||
this.linkLabel1.TabIndex = 18;
|
||||
this.linkLabel1.TabStop = true;
|
||||
this.linkLabel1.Text = "elctrobrains (Branched off of)";
|
||||
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
|
||||
this.linkElectro.AutoSize = true;
|
||||
this.linkElectro.Location = new System.Drawing.Point(215, 216);
|
||||
this.linkElectro.Name = "linkElectro";
|
||||
this.linkElectro.Size = new System.Drawing.Size(143, 13);
|
||||
this.linkElectro.TabIndex = 18;
|
||||
this.linkElectro.TabStop = true;
|
||||
this.linkElectro.Text = "elctrobrains (Branched off of)";
|
||||
this.linkElectro.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
|
||||
//
|
||||
// linkLabel2
|
||||
// linkJays2Kings
|
||||
//
|
||||
this.linkLabel2.AutoSize = true;
|
||||
this.linkLabel2.Location = new System.Drawing.Point(105, 194);
|
||||
this.linkLabel2.Name = "linkLabel2";
|
||||
this.linkLabel2.Size = new System.Drawing.Size(92, 13);
|
||||
this.linkLabel2.TabIndex = 18;
|
||||
this.linkLabel2.TabStop = true;
|
||||
this.linkLabel2.Text = "Jays2Kings (Mine)";
|
||||
this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked);
|
||||
this.linkJays2Kings.AutoSize = true;
|
||||
this.linkJays2Kings.Location = new System.Drawing.Point(95, 216);
|
||||
this.linkJays2Kings.Name = "linkJays2Kings";
|
||||
this.linkJays2Kings.Size = new System.Drawing.Size(60, 13);
|
||||
this.linkJays2Kings.TabIndex = 18;
|
||||
this.linkJays2Kings.TabStop = true;
|
||||
this.linkJays2Kings.Text = "Jays2Kings";
|
||||
this.linkJays2Kings.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(26, 194);
|
||||
this.label2.Location = new System.Drawing.Point(146, 194);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(72, 13);
|
||||
this.label2.Size = new System.Drawing.Size(109, 13);
|
||||
this.label2.TabIndex = 13;
|
||||
this.label2.Text = "Source Code:";
|
||||
this.label2.Text = "Credits/Source Code:";
|
||||
//
|
||||
// lbAbout
|
||||
//
|
||||
@ -206,17 +209,54 @@
|
||||
this.lbAbout.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lbAbout.Location = new System.Drawing.Point(26, 9);
|
||||
this.lbAbout.Name = "lbAbout";
|
||||
this.lbAbout.Size = new System.Drawing.Size(201, 13);
|
||||
this.lbAbout.Size = new System.Drawing.Size(243, 13);
|
||||
this.lbAbout.TabIndex = 0;
|
||||
this.lbAbout.Text = "DS4Windows - J2K Build (Version ";
|
||||
this.lbAbout.Text = "DS4Windows - Jays2Kings Build (Version ";
|
||||
//
|
||||
// linkInhexSTER
|
||||
//
|
||||
this.linkInhexSTER.AutoSize = true;
|
||||
this.linkInhexSTER.Location = new System.Drawing.Point(38, 243);
|
||||
this.linkInhexSTER.Name = "linkInhexSTER";
|
||||
this.linkInhexSTER.Size = new System.Drawing.Size(159, 13);
|
||||
this.linkInhexSTER.TabIndex = 18;
|
||||
this.linkInhexSTER.TabStop = true;
|
||||
this.linkInhexSTER.Text = "InhexSTER (Starter of DS4Tool)";
|
||||
this.linkInhexSTER.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkInhexSTER_LinkClicked);
|
||||
//
|
||||
// linkJhebbel
|
||||
//
|
||||
this.linkJhebbel.AutoSize = true;
|
||||
this.linkJhebbel.Location = new System.Drawing.Point(268, 243);
|
||||
this.linkJhebbel.Name = "linkJhebbel";
|
||||
this.linkJhebbel.Size = new System.Drawing.Size(41, 13);
|
||||
this.linkJhebbel.TabIndex = 18;
|
||||
this.linkJhebbel.TabStop = true;
|
||||
this.linkJhebbel.Text = "jhebbel";
|
||||
this.linkJhebbel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkJhebbel_LinkClicked);
|
||||
//
|
||||
// linkUninstall
|
||||
//
|
||||
this.linkUninstall.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.linkUninstall.AutoSize = true;
|
||||
this.linkUninstall.Location = new System.Drawing.Point(12, 280);
|
||||
this.linkUninstall.Name = "linkUninstall";
|
||||
this.linkUninstall.Size = new System.Drawing.Size(106, 13);
|
||||
this.linkUninstall.TabIndex = 17;
|
||||
this.linkUninstall.TabStop = true;
|
||||
this.linkUninstall.Text = "Uninstall VBus Driver";
|
||||
this.linkUninstall.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkUninstall_LinkClicked);
|
||||
//
|
||||
// Hotkeys
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(399, 244);
|
||||
this.Controls.Add(this.linkLabel2);
|
||||
this.Controls.Add(this.linkLabel1);
|
||||
this.ClientSize = new System.Drawing.Size(399, 302);
|
||||
this.Controls.Add(this.linkJhebbel);
|
||||
this.Controls.Add(this.linkInhexSTER);
|
||||
this.Controls.Add(this.linkJays2Kings);
|
||||
this.Controls.Add(this.linkElectro);
|
||||
this.Controls.Add(this.linkUninstall);
|
||||
this.Controls.Add(this.linkProfiles);
|
||||
this.Controls.Add(this.label14);
|
||||
this.Controls.Add(this.label15);
|
||||
@ -257,9 +297,12 @@
|
||||
private System.Windows.Forms.Label label14;
|
||||
private System.Windows.Forms.Label label15;
|
||||
private System.Windows.Forms.LinkLabel linkProfiles;
|
||||
private System.Windows.Forms.LinkLabel linkLabel1;
|
||||
private System.Windows.Forms.LinkLabel linkLabel2;
|
||||
private System.Windows.Forms.LinkLabel linkElectro;
|
||||
private System.Windows.Forms.LinkLabel linkJays2Kings;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label lbAbout;
|
||||
private System.Windows.Forms.LinkLabel linkInhexSTER;
|
||||
private System.Windows.Forms.LinkLabel linkJhebbel;
|
||||
private System.Windows.Forms.LinkLabel linkUninstall;
|
||||
}
|
||||
}
|
@ -16,6 +16,10 @@ namespace ScpServer
|
||||
{
|
||||
InitializeComponent();
|
||||
lbAbout.Text += Global.getVersion().ToString() + ")";
|
||||
ToolTip tt = new ToolTip();
|
||||
tt.SetToolTip(linkUninstall, "To fully remove DS4Windows, You can delete the profiles by the link to the other side");
|
||||
if (!System.IO.Directory.Exists(Global.appdatapath + "\\Virtual Bus Driver"))
|
||||
linkUninstall.Visible = false;
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
@ -37,5 +41,20 @@ namespace ScpServer
|
||||
{
|
||||
System.Diagnostics.Process.Start("https://code.google.com/r/brianfundakowskifeldman-ds4windows/");
|
||||
}
|
||||
|
||||
private void linkInhexSTER_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("https://code.google.com/p/ds4-tool/");
|
||||
}
|
||||
|
||||
private void linkJhebbel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("https://code.google.com/r/jhebbel-ds4tool/source/browse/");
|
||||
}
|
||||
|
||||
private void linkUninstall_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start(Global.appdatapath + "\\Virtual Bus Driver\\ScpDriver.exe");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -159,4 +159,7 @@
|
||||
<data name="UpperTouch" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\UpperTouch.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Pairmode" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Pairmode.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
12
DS4Tool/Properties/Resources1.Designer.cs
generated
12
DS4Tool/Properties/Resources1.Designer.cs
generated
@ -1,7 +1,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34014
|
||||
// Runtime Version:4.0.30319.34209
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@ -120,6 +120,16 @@ namespace ScpServer.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap Pairmode {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Pairmode", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
4
DS4Tool/Properties/Settings.Designer.cs
generated
4
DS4Tool/Properties/Settings.Designer.cs
generated
@ -1,7 +1,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34011
|
||||
// Runtime Version:4.0.30319.34209
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@ -12,7 +12,7 @@ namespace ScpServer.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
BIN
DS4Tool/Resources/Pairmode.png
Normal file
BIN
DS4Tool/Resources/Pairmode.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
@ -7,13 +7,14 @@ using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Management;
|
||||
namespace ScpServer
|
||||
{
|
||||
public partial class ScpForm : Form
|
||||
{
|
||||
private DS4Control.Control rootHub;
|
||||
delegate void LogDebugDelegate(DateTime Time, String Data);
|
||||
double version = 6.95;
|
||||
double version = 7.011;
|
||||
|
||||
protected Label[] Pads;
|
||||
protected ComboBox[] cbs;
|
||||
@ -40,11 +41,41 @@ namespace ScpServer
|
||||
(ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[3] };
|
||||
foreach (ToolStripMenuItem t in shortcuts)
|
||||
t.DropDownItemClicked += Profile_Changed_Menu;
|
||||
CheckDrivers();
|
||||
Uri url = new Uri("https://dl.dropboxusercontent.com/u/16364552/DS4Tool/newest%20version.txt"); //Sorry other devs, gonna have to find your own server
|
||||
Directory.CreateDirectory(Global.appdatapath);
|
||||
wc.DownloadFileAsync(url, Global.appdatapath + "\\version.txt");
|
||||
wc.DownloadFileCompleted += Check_Version;
|
||||
|
||||
|
||||
if (!File.Exists("Updater.exe"))
|
||||
{
|
||||
Uri url2 = new Uri("https://dl.dropboxusercontent.com/u/16364552/DS4Tool/Updater.exe");
|
||||
WebClient wc2 = new WebClient();
|
||||
wc2.DownloadFileAsync(url2, "Updater.exe");
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckDrivers()
|
||||
{
|
||||
bool deriverinstalled = false;
|
||||
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_PnPSignedDriver");
|
||||
foreach (ManagementObject obj in searcher.Get())
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj.GetPropertyValue("DeviceName").ToString() == "Scp Virtual Bus Driver")
|
||||
{
|
||||
deriverinstalled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
if (!deriverinstalled)
|
||||
{
|
||||
WelcomeDialog wd = new WelcomeDialog();
|
||||
wd.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void Check_Version(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
|
||||
@ -116,23 +147,20 @@ namespace ScpServer
|
||||
{
|
||||
try
|
||||
{
|
||||
string[] profiles = System.IO.Directory.GetFiles(Global.appdatapath + @"\Profiles\");
|
||||
int cutoff = (Global.appdatapath + @"\Profiles\").Length;
|
||||
string[] profiles = Directory.GetFiles(Global.appdatapath + @"\Profiles\");
|
||||
List<string> profilenames = new List<string>();
|
||||
foreach (String s in profiles)
|
||||
if (s.EndsWith(".xml"))
|
||||
profilenames.Add(s.Substring(cutoff, s.Length - 4 - cutoff));
|
||||
profilenames.Add(Path.GetFileNameWithoutExtension(s));
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
cbs[i].Items.Clear();
|
||||
shortcuts[i].DropDownItems.Clear();
|
||||
string[] profileA = Global.getAProfile(i).Split('\\');
|
||||
string filename = profileA[profileA.Length - 1];
|
||||
cbs[i].Items.AddRange(profilenames.ToArray());
|
||||
foreach (string s in profilenames)
|
||||
shortcuts[i].DropDownItems.Add(s);
|
||||
shortcuts[i].DropDownItems.Add(Path.GetFileNameWithoutExtension(s));
|
||||
for (int j = 0; j < cbs[i].Items.Count; j++)
|
||||
if (cbs[i].Items[j] + ".xml" == filename)
|
||||
if (cbs[i].Items[j].ToString() == Path.GetFileNameWithoutExtension(Global.getAProfile(i)))
|
||||
{
|
||||
cbs[i].SelectedIndex = j;
|
||||
((ToolStripMenuItem)shortcuts[i].DropDownItems[j]).Checked = true;
|
||||
@ -182,7 +210,7 @@ namespace ScpServer
|
||||
}
|
||||
else
|
||||
{
|
||||
String Posted = Time.ToString("O");
|
||||
String Posted = Time.ToString("G");
|
||||
|
||||
lvDebug.Items.Add(new ListViewItem(new String[] { Posted, Data })).EnsureVisible();
|
||||
|
||||
@ -206,22 +234,25 @@ namespace ScpServer
|
||||
this.Hide();
|
||||
this.ShowInTaskbar = false;
|
||||
}
|
||||
|
||||
else if (FormWindowState.Normal == this.WindowState)
|
||||
{
|
||||
notifyIcon1.Visible = false;
|
||||
this.Show();
|
||||
this.ShowInTaskbar = true;
|
||||
}
|
||||
|
||||
//Added last message alternative
|
||||
|
||||
if (this.Height > 220)
|
||||
lbLastMessage.Visible = false;
|
||||
else lbLastMessage.Visible = true;
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
if (this.Width > 665)
|
||||
protexts[i].Visible = true;
|
||||
else
|
||||
protexts[i].Visible = false;
|
||||
if (protexts != null)
|
||||
for (int i = 0; i < 4; i++)
|
||||
if (this.Width > 665)
|
||||
protexts[i].Visible = true;
|
||||
else
|
||||
protexts[i].Visible = false;
|
||||
}
|
||||
|
||||
protected void btnStartStop_Click(object sender, EventArgs e)
|
||||
|
181
DS4Tool/WelcomeDialog.Designer.cs
generated
Normal file
181
DS4Tool/WelcomeDialog.Designer.cs
generated
Normal file
@ -0,0 +1,181 @@
|
||||
namespace ScpServer
|
||||
{
|
||||
partial class WelcomeDialog
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.bnFinish = new System.Windows.Forms.Button();
|
||||
this.bnStep1 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.labelBluetooth = new System.Windows.Forms.Label();
|
||||
this.labelUSB = new System.Windows.Forms.Label();
|
||||
this.labelBluetooth2 = new System.Windows.Forms.Label();
|
||||
this.linkBluetoothSettings = new System.Windows.Forms.LinkLabel();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// bnFinish
|
||||
//
|
||||
this.bnFinish.Location = new System.Drawing.Point(123, 388);
|
||||
this.bnFinish.Name = "bnFinish";
|
||||
this.bnFinish.Size = new System.Drawing.Size(75, 23);
|
||||
this.bnFinish.TabIndex = 0;
|
||||
this.bnFinish.Text = "Finish";
|
||||
this.bnFinish.UseVisualStyleBackColor = true;
|
||||
this.bnFinish.Click += new System.EventHandler(this.bnFinish_Click);
|
||||
//
|
||||
// bnStep1
|
||||
//
|
||||
this.bnStep1.Location = new System.Drawing.Point(82, 8);
|
||||
this.bnStep1.Name = "bnStep1";
|
||||
this.bnStep1.Size = new System.Drawing.Size(155, 23);
|
||||
this.bnStep1.TabIndex = 1;
|
||||
this.bnStep1.Text = "Step 1: Install the DS4 Driver";
|
||||
this.bnStep1.UseVisualStyleBackColor = true;
|
||||
this.bnStep1.Click += new System.EventHandler(this.bnStep1_Click);
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Location = new System.Drawing.Point(29, 57);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(259, 23);
|
||||
this.button2.TabIndex = 1;
|
||||
this.button2.Text = "Step 2: If on Windows 7 or below, Install 360 Drvier";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.Image = global::ScpServer.Properties.Resources.Pairmode;
|
||||
this.pictureBox1.InitialImage = null;
|
||||
this.pictureBox1.Location = new System.Drawing.Point(36, 197);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(245, 132);
|
||||
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||
this.pictureBox1.TabIndex = 2;
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// labelBluetooth
|
||||
//
|
||||
this.labelBluetooth.Location = new System.Drawing.Point(1, 155);
|
||||
this.labelBluetooth.Name = "labelBluetooth";
|
||||
this.labelBluetooth.Size = new System.Drawing.Size(312, 39);
|
||||
this.labelBluetooth.TabIndex = 3;
|
||||
this.labelBluetooth.Text = "To set up bluetooth (optional):\r\nHold the PS Button and Share for 3 seconds\r\nThe " +
|
||||
"lightbar will begin to double flash";
|
||||
this.labelBluetooth.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// labelUSB
|
||||
//
|
||||
this.labelUSB.Location = new System.Drawing.Point(0, 106);
|
||||
this.labelUSB.Name = "labelUSB";
|
||||
this.labelUSB.Size = new System.Drawing.Size(313, 39);
|
||||
this.labelUSB.TabIndex = 3;
|
||||
this.labelUSB.Text = "Step 3: Connecting the DualShock 4 controller\r\nTo set up wired/usb:\r\nSimply plug " +
|
||||
"a mirco usb into your PC and DualShock 4";
|
||||
this.labelUSB.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// labelBluetooth2
|
||||
//
|
||||
this.labelBluetooth2.Location = new System.Drawing.Point(1, 332);
|
||||
this.labelBluetooth2.Name = "labelBluetooth2";
|
||||
this.labelBluetooth2.Size = new System.Drawing.Size(312, 64);
|
||||
this.labelBluetooth2.TabIndex = 3;
|
||||
this.labelBluetooth2.Text = "Once flashing go to your Bluetooth Settings\r\nand Connect to \"Wireless Controller\"" +
|
||||
"\r\n\r\nOnce paired, you\'re good to go. Have fun!";
|
||||
this.labelBluetooth2.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// linkBluetoothSettings
|
||||
//
|
||||
this.linkBluetoothSettings.AutoSize = true;
|
||||
this.linkBluetoothSettings.Location = new System.Drawing.Point(169, 332);
|
||||
this.linkBluetoothSettings.Name = "linkBluetoothSettings";
|
||||
this.linkBluetoothSettings.Size = new System.Drawing.Size(93, 13);
|
||||
this.linkBluetoothSettings.TabIndex = 4;
|
||||
this.linkBluetoothSettings.TabStop = true;
|
||||
this.linkBluetoothSettings.Text = "Bluetooth Settings";
|
||||
this.linkBluetoothSettings.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkBluetoothSettings_LinkClicked);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Location = new System.Drawing.Point(1, 32);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(314, 22);
|
||||
this.label1.TabIndex = 3;
|
||||
this.label1.Text = "Make sure to check Force Install";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Location = new System.Drawing.Point(0, 82);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(315, 22);
|
||||
this.label2.TabIndex = 3;
|
||||
this.label2.Text = "You do not have to do this if you have before";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// WelcomeDialog
|
||||
//
|
||||
this.AcceptButton = this.bnFinish;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(315, 422);
|
||||
this.Controls.Add(this.linkBluetoothSettings);
|
||||
this.Controls.Add(this.labelBluetooth);
|
||||
this.Controls.Add(this.pictureBox1);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.bnStep1);
|
||||
this.Controls.Add(this.bnFinish);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.labelUSB);
|
||||
this.Controls.Add(this.labelBluetooth2);
|
||||
this.Name = "WelcomeDialog";
|
||||
this.Text = "Welcome to DS4Windows";
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button bnFinish;
|
||||
private System.Windows.Forms.Button bnStep1;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.Label labelBluetooth;
|
||||
private System.Windows.Forms.Label labelUSB;
|
||||
private System.Windows.Forms.Label labelBluetooth2;
|
||||
private System.Windows.Forms.LinkLabel linkBluetoothSettings;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
}
|
||||
}
|
139
DS4Tool/WelcomeDialog.cs
Normal file
139
DS4Tool/WelcomeDialog.cs
Normal file
@ -0,0 +1,139 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Net;
|
||||
using DS4Control;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Principal;
|
||||
using System.Security.Permissions;
|
||||
using System.Reflection;
|
||||
|
||||
namespace ScpServer
|
||||
{
|
||||
public partial class WelcomeDialog : Form
|
||||
{
|
||||
public WelcomeDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Icon = Properties.Resources.DS4;
|
||||
if (!File.Exists("Updater.exe"))
|
||||
{
|
||||
Uri url2 = new Uri("https://dl.dropboxusercontent.com/u/16364552/DS4Tool/Updater.exe");
|
||||
WebClient wc2 = new WebClient();
|
||||
wc2.DownloadFileAsync(url2, "Updater.exe");
|
||||
}
|
||||
}
|
||||
|
||||
private void bnFinish_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void linkBluetoothSettings_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
Process.Start("control", "bthprops.cpl");
|
||||
}
|
||||
|
||||
private void bnStep1_Click(object sender, EventArgs e)
|
||||
{
|
||||
WebClient wb = new WebClient();
|
||||
if (bnStep1.Text == "Step 1: Install the DS4 Driver")
|
||||
{
|
||||
wb.DownloadFileAsync(new Uri("https://docs.google.com/uc?authuser=0&id=0BwPaAe9M8N9mYVdPakJ6OXpMUlU&export=download"), Global.appdatapath + "\\VBus.zip");
|
||||
wb.DownloadProgressChanged += wb_DownloadProgressChanged;
|
||||
wb.DownloadFileCompleted += wb_DownloadFileCompleted;
|
||||
}
|
||||
}
|
||||
|
||||
private void wb_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
|
||||
{
|
||||
bnStep1.Text = "Downloading " + e.ProgressPercentage + "%";
|
||||
}
|
||||
|
||||
string exepath = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName;
|
||||
private void wb_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
|
||||
{
|
||||
if (!exepath.StartsWith("C:\\Program Files") && !exepath.StartsWith("C:\\Windows"))
|
||||
{
|
||||
bnStep1.Text = "Opening Installer";
|
||||
try
|
||||
{
|
||||
File.Delete(exepath + "\\ScpDriver.exe");
|
||||
File.Delete(exepath + "\\ScpDriver.log");
|
||||
Directory.Delete(exepath + "\\System", true);
|
||||
Directory.Delete(exepath + "\\DIFxAPI", true);
|
||||
}
|
||||
catch { }
|
||||
Directory.CreateDirectory(Global.appdatapath + "\\Virtual Bus Driver");
|
||||
try { ZipFile.ExtractToDirectory(Global.appdatapath + "\\VBus.zip", Global.appdatapath + "\\Virtual Bus Driver"); } //Saved so the user can uninstall later
|
||||
catch { }
|
||||
try { ZipFile.ExtractToDirectory(Global.appdatapath + "\\VBus.zip", exepath); }
|
||||
//Made here as starting the scpdriver.exe via process.start, the program looks for file from where it was called, not where the exe is
|
||||
catch { }
|
||||
Process.Start(exepath + "\\ScpDriver.exe");
|
||||
Timer timer = new Timer();
|
||||
timer.Start();
|
||||
timer.Tick += timer_Tick;
|
||||
}
|
||||
else
|
||||
{
|
||||
bnStep1.Text = "Please Open ScpDriver.exe";
|
||||
Directory.CreateDirectory(Global.appdatapath + "\\Virtual Bus Driver");
|
||||
try { ZipFile.ExtractToDirectory(Global.appdatapath + "\\VBus.zip", Global.appdatapath + "\\Virtual Bus Driver"); }
|
||||
catch { }
|
||||
Process.Start(Global.appdatapath + "\\Virtual Bus Driver");
|
||||
Timer timer = new Timer();
|
||||
timer.Start();
|
||||
timer.Tick += timer_Tick;
|
||||
}
|
||||
}
|
||||
|
||||
bool running = false;
|
||||
private void timer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
Process[] processes = Process.GetProcessesByName("ScpDriver");
|
||||
if (!exepath.StartsWith("C:\\Program Files") && !exepath.StartsWith("C:\\Windows"))
|
||||
{
|
||||
if (processes.Length < 1)
|
||||
{
|
||||
bnStep1.Text = "Install Complete";
|
||||
|
||||
try
|
||||
{
|
||||
File.Delete(exepath + "\\ScpDriver.exe");
|
||||
File.Delete(exepath + "\\ScpDriver.log");
|
||||
Directory.Delete(exepath + "\\System", true);
|
||||
Directory.Delete(exepath + "\\DIFxAPI", true);
|
||||
}
|
||||
catch { }
|
||||
File.Delete(Global.appdatapath + "\\VBus.zip");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (processes.Length > 0)
|
||||
running = true;
|
||||
if (running)
|
||||
if (processes.Length < 1)
|
||||
{
|
||||
bnStep1.Text = "Install Complete";
|
||||
File.Delete(Global.appdatapath + "\\VBus.zip");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
Process.Start("http://www.microsoft.com/hardware/en-us/d/xbox-360-controller-for-windows");
|
||||
}
|
||||
}
|
||||
}
|
120
DS4Tool/WelcomeDialog.resx
Normal file
120
DS4Tool/WelcomeDialog.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
@ -1,3 +1,3 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
|
||||
|
Loading…
x
Reference in New Issue
Block a user