Skip to content

Commit 81b3549

Browse files
committed
Add comments to the data transformer to explain that the various boxes do.
Update gitapp version.
1 parent 4b5584b commit 81b3549

File tree

10 files changed

+855
-11
lines changed

10 files changed

+855
-11
lines changed

StructuredXmlEditor/App.xaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
Source="View/Styles/ListView.xaml" />
4545
<v:SharedResourceDictionary
4646
Source="View/Styles/XmlDataView.xaml" />
47+
<v:SharedResourceDictionary
48+
Source="View/Styles/PromptTextBox.xaml" />
49+
<v:SharedResourceDictionary
50+
Source="View/Styles/AutoCompleteTextBox.xaml" />
4751

4852
<v:SharedResourceDictionary
4953
Source="View/Styles/AvalonDock.xaml" />

StructuredXmlEditor/StructuredXmlEditor.csproj

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.2.0.306\build\net46\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.2.0.306\build\net46\LibGit2Sharp.NativeBinaries.props')" />
34
<Import Project="..\packages\Costura.Fody.3.3.3\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.3.3.3\build\Costura.Fody.props')" />
45
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
56
<PropertyGroup>
@@ -49,6 +50,9 @@
4950
<Reference Include="DiffPlex, Version=1.5.0.0, Culture=neutral, PublicKeyToken=1d35e91d1bd7bc0f, processorArchitecture=MSIL">
5051
<HintPath>..\packages\DiffPlex.1.5.0\lib\net40\DiffPlex.dll</HintPath>
5152
</Reference>
53+
<Reference Include="LibGit2Sharp, Version=0.26.0.0, Culture=neutral, PublicKeyToken=7cbde695407f0333, processorArchitecture=MSIL">
54+
<HintPath>..\packages\LibGit2Sharp.0.26.2\lib\net46\LibGit2Sharp.dll</HintPath>
55+
</Reference>
5256
<Reference Include="NCalc, Version=1.3.8.0, Culture=neutral, PublicKeyToken=973cde3f1cafed03, processorArchitecture=MSIL">
5357
<HintPath>..\packages\ncalc.1.3.8\lib\NCalc.dll</HintPath>
5458
<Private>True</Private>
@@ -70,6 +74,12 @@
7074
<Reference Include="System.Xaml">
7175
<RequiredTargetFramework>4.0</RequiredTargetFramework>
7276
</Reference>
77+
<Reference Include="ToastNotifications, Version=2.5.1.0, Culture=neutral, PublicKeyToken=e89d9d7314a7c797, processorArchitecture=MSIL">
78+
<HintPath>..\packages\ToastNotifications.2.5.1\lib\net40\ToastNotifications.dll</HintPath>
79+
</Reference>
80+
<Reference Include="ToastNotifications.Messages, Version=2.5.1.0, Culture=neutral, PublicKeyToken=e89d9d7314a7c797, processorArchitecture=MSIL">
81+
<HintPath>..\packages\ToastNotifications.Messages.2.5.1\lib\net40\ToastNotifications.Messages.dll</HintPath>
82+
</Reference>
7383
<Reference Include="WindowsBase" />
7484
<Reference Include="PresentationCore" />
7585
<Reference Include="PresentationFramework" />
@@ -154,6 +164,25 @@
154164
<Compile Include="Tools\DataTransformerTool.cs" />
155165
<Compile Include="Tools\FocusTool.cs" />
156166
<Compile Include="Tools\GitTool.cs" />
167+
<Compile Include="Tools\GitTool\GitApp\BranchPopup.xaml.cs">
168+
<DependentUpon>BranchPopup.xaml</DependentUpon>
169+
</Compile>
170+
<Compile Include="Tools\GitTool\GitApp\CommitSelectorPopup.xaml.cs">
171+
<DependentUpon>CommitSelectorPopup.xaml</DependentUpon>
172+
</Compile>
173+
<Compile Include="Tools\GitTool\GitApp\ConflictsDialog.xaml.cs">
174+
<DependentUpon>ConflictsDialog.xaml</DependentUpon>
175+
</Compile>
176+
<Compile Include="Tools\GitTool\GitApp\GitCommit.cs" />
177+
<Compile Include="Tools\GitTool\GitApp\GitDiff.cs" />
178+
<Compile Include="Tools\GitTool\GitApp\GitLog.cs" />
179+
<Compile Include="Tools\GitTool\GitApp\GitMerge.cs" />
180+
<Compile Include="Tools\GitTool\GitApp\GitPull.cs" />
181+
<Compile Include="Tools\GitTool\GitApp\GitPush.cs" />
182+
<Compile Include="Tools\GitTool\GitApp\GitStatus.cs" />
183+
<Compile Include="Tools\GitTool\GitApp\MainWindow.xaml.cs">
184+
<DependentUpon>MainWindow.xaml</DependentUpon>
185+
</Compile>
157186
<Compile Include="Tools\GitTool\GitApp\Util\Command.cs" />
158187
<Compile Include="Tools\GitTool\GitApp\Util\Extensions.cs" />
159188
<Compile Include="Tools\GitTool\GitApp\Util\Future.cs" />
@@ -209,6 +238,7 @@
209238
<DependentUpon>AnimatedImage.xaml</DependentUpon>
210239
</Compile>
211240
<Compile Include="View\CustomControls\AsciiGrid.cs" />
241+
<Compile Include="View\CustomControls\AutoCompleteTextBox.cs" />
212242
<Compile Include="View\CustomControls\ColourPicker\ColorCanvas.cs" />
213243
<Compile Include="View\CustomControls\ColourPicker\ColorSpectrumSlider.cs" />
214244
<Compile Include="View\CustomControls\ColourPicker\ColourUtilities.cs" />
@@ -238,6 +268,7 @@
238268
<Compile Include="View\CustomControls\ProjectViewView.xaml.cs">
239269
<DependentUpon>ProjectViewView.xaml</DependentUpon>
240270
</Compile>
271+
<Compile Include="View\CustomControls\PromptTextBox.cs" />
241272
<Compile Include="View\CustomControls\SkeletalAnimation\AnimationTimeline.cs" />
242273
<Compile Include="View\CustomControls\SkeletalAnimation\SkeletalAnimationEditor.xaml.cs">
243274
<DependentUpon>SkeletalAnimationEditor.xaml</DependentUpon>
@@ -286,6 +317,22 @@
286317
<DependentUpon>MainWindow.xaml</DependentUpon>
287318
<SubType>Code</SubType>
288319
</Compile>
320+
<Page Include="Tools\GitTool\GitApp\BranchPopup.xaml">
321+
<Generator>MSBuild:Compile</Generator>
322+
<SubType>Designer</SubType>
323+
</Page>
324+
<Page Include="Tools\GitTool\GitApp\CommitSelectorPopup.xaml">
325+
<Generator>MSBuild:Compile</Generator>
326+
<SubType>Designer</SubType>
327+
</Page>
328+
<Page Include="Tools\GitTool\GitApp\ConflictsDialog.xaml">
329+
<Generator>MSBuild:Compile</Generator>
330+
<SubType>Designer</SubType>
331+
</Page>
332+
<Page Include="Tools\GitTool\GitApp\MainWindow.xaml">
333+
<Generator>MSBuild:Compile</Generator>
334+
<SubType>Designer</SubType>
335+
</Page>
289336
<Page Include="Tools\GitTool\GitApp\ViewModelView.xaml">
290337
<SubType>Designer</SubType>
291338
<Generator>MSBuild:Compile</Generator>
@@ -299,8 +346,8 @@
299346
<SubType>Designer</SubType>
300347
</Page>
301348
<Page Include="Tools\GitTool\GitApp\View\Styles\AutoCompleteTextBox.xaml">
302-
<Generator>MSBuild:Compile</Generator>
303349
<SubType>Designer</SubType>
350+
<Generator>XamlIntelliSenseFileGenerator</Generator>
304351
</Page>
305352
<Page Include="Tools\GitTool\GitApp\View\Styles\Brushes.xaml">
306353
<Generator>MSBuild:Compile</Generator>
@@ -347,8 +394,8 @@
347394
<SubType>Designer</SubType>
348395
</Page>
349396
<Page Include="Tools\GitTool\GitApp\View\Styles\PromptTextBox.xaml">
350-
<Generator>MSBuild:Compile</Generator>
351397
<SubType>Designer</SubType>
398+
<Generator>XamlIntelliSenseFileGenerator</Generator>
352399
</Page>
353400
<Page Include="Tools\GitTool\GitApp\View\Styles\Scrollbar.xaml">
354401
<Generator>MSBuild:Compile</Generator>
@@ -406,6 +453,10 @@
406453
<SubType>Designer</SubType>
407454
<Generator>MSBuild:Compile</Generator>
408455
</Page>
456+
<Page Include="View\Styles\AutoCompleteTextBox.xaml">
457+
<Generator>MSBuild:Compile</Generator>
458+
<SubType>Designer</SubType>
459+
</Page>
409460
<Page Include="View\Styles\AvalonDock.xaml">
410461
<SubType>Designer</SubType>
411462
<Generator>MSBuild:Compile</Generator>
@@ -430,6 +481,10 @@
430481
<Generator>MSBuild:Compile</Generator>
431482
<SubType>Designer</SubType>
432483
</Page>
484+
<Page Include="View\Styles\PromptTextBox.xaml">
485+
<Generator>MSBuild:Compile</Generator>
486+
<SubType>Designer</SubType>
487+
</Page>
433488
<Page Include="View\Styles\XmlDataViewTemplates.xaml">
434489
<Generator>MSBuild:Compile</Generator>
435490
<SubType>Designer</SubType>
@@ -588,6 +643,7 @@
588643
</PropertyGroup>
589644
<Error Condition="!Exists('..\packages\Fody.4.2.1\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.4.2.1\build\Fody.targets'))" />
590645
<Error Condition="!Exists('..\packages\Costura.Fody.3.3.3\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.3.3\build\Costura.Fody.props'))" />
646+
<Error Condition="!Exists('..\packages\LibGit2Sharp.NativeBinaries.2.0.306\build\net46\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.NativeBinaries.2.0.306\build\net46\LibGit2Sharp.NativeBinaries.props'))" />
591647
</Target>
592648
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
593649
Other similar extension points exist, see Microsoft.Common.targets.

StructuredXmlEditor/Util/Extensions.cs

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
using System.Globalization;
77
using System.IO;
88
using System.Linq;
9+
using System.Runtime.InteropServices;
910
using System.Text;
1011
using System.Threading.Tasks;
1112
using System.Windows.Controls;
13+
using System.Windows.Input;
1214
using System.Windows.Media;
1315
using System.Xml.Serialization;
1416

@@ -238,5 +240,72 @@ public static void AddCheckable(this MenuItem menu, string header, Action<bool>
238240

239241
menu.Items.Add(item);
240242
}
243+
244+
//################################################################################################
245+
#region GetCharFromKey
246+
247+
// ==========================================================================================
248+
public enum MapType : uint
249+
{
250+
MAPVK_VK_TO_VSC = 0x0,
251+
MAPVK_VSC_TO_VK = 0x1,
252+
MAPVK_VK_TO_CHAR = 0x2,
253+
MAPVK_VSC_TO_VK_EX = 0x3,
254+
}
255+
256+
// ==========================================================================================
257+
[DllImport("user32.dll")]
258+
public static extern int ToUnicode(
259+
uint wVirtKey,
260+
uint wScanCode,
261+
byte[] lpKeyState,
262+
[Out, MarshalAs(UnmanagedType.LPWStr, SizeParamIndex = 4)]
263+
StringBuilder pwszBuff,
264+
int cchBuff,
265+
uint wFlags);
266+
267+
// ==========================================================================================
268+
[DllImport("user32.dll")]
269+
public static extern bool GetKeyboardState(byte[] lpKeyState);
270+
271+
// ==========================================================================================
272+
[DllImport("user32.dll")]
273+
public static extern uint MapVirtualKey(uint uCode, MapType uMapType);
274+
275+
// ==========================================================================================
276+
public static char GetCharFromKey(this Key key)
277+
{
278+
char ch = ' ';
279+
280+
int virtualKey = KeyInterop.VirtualKeyFromKey(key);
281+
byte[] keyboardState = new byte[256];
282+
GetKeyboardState(keyboardState);
283+
284+
uint scanCode = MapVirtualKey((uint)virtualKey, MapType.MAPVK_VK_TO_VSC);
285+
StringBuilder stringBuilder = new StringBuilder(2);
286+
287+
int result = ToUnicode((uint)virtualKey, scanCode, keyboardState, stringBuilder, stringBuilder.Capacity, 0);
288+
switch (result)
289+
{
290+
case -1:
291+
break;
292+
case 0:
293+
break;
294+
case 1:
295+
{
296+
ch = stringBuilder[0];
297+
break;
298+
}
299+
default:
300+
{
301+
ch = stringBuilder[0];
302+
break;
303+
}
304+
}
305+
return ch;
306+
}
307+
308+
#endregion GetCharFromKey
309+
//################################################################################################
241310
}
242311
}

0 commit comments

Comments
 (0)