inital
This commit is contained in:
88
FasdDesktopUi/Basics/Models/HotKeyInformation.cs
Normal file
88
FasdDesktopUi/Basics/Models/HotKeyInformation.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
using C4IT.MultiLanguage;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using static C4IT.Logging.cLogManager;
|
||||
|
||||
namespace FasdDesktopUi.Basics.Models
|
||||
{
|
||||
public class cHotKeyCategoryInformation
|
||||
{
|
||||
public cMultiLanguageDictionary Names { get; set; } = new cMultiLanguageDictionary();
|
||||
public List<cHotKeyInformation> HotKeyInformation { get; set; }
|
||||
}
|
||||
|
||||
public class cHotKeyInformation
|
||||
{
|
||||
public cMultiLanguageDictionary Names { get; set; } = new cMultiLanguageDictionary();
|
||||
public List<ModifierKeys> Modifiers { get; set; } = new List<ModifierKeys>();
|
||||
public Key HotKey { get; set; }
|
||||
public Key? AlternativeKey { get; set; }
|
||||
|
||||
public string GetKeyDisplayString(Key key)
|
||||
{
|
||||
string output = key.ToString();
|
||||
try
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
case Key.Tab:
|
||||
output = "Tab ↹";
|
||||
break;
|
||||
case Key.Enter:
|
||||
output = "Enter ↲";
|
||||
break;
|
||||
case Key.Escape:
|
||||
output = "ESC";
|
||||
break;
|
||||
case Key.Space:
|
||||
output = " ";
|
||||
break;
|
||||
case Key.Left:
|
||||
output = "←";
|
||||
break;
|
||||
case Key.Up:
|
||||
output = "↑";
|
||||
break;
|
||||
case Key.Right:
|
||||
output = "→";
|
||||
break;
|
||||
case Key.Down:
|
||||
output = "↓";
|
||||
break;
|
||||
case Key.Multiply:
|
||||
output = "*";
|
||||
break;
|
||||
case Key.OemPlus:
|
||||
case Key.Add:
|
||||
output = "+";
|
||||
break;
|
||||
case Key.OemMinus:
|
||||
case Key.Separator:
|
||||
case Key.Subtract:
|
||||
output = "-";
|
||||
break;
|
||||
case Key.Decimal:
|
||||
output = ",";
|
||||
break;
|
||||
case Key.Divide:
|
||||
output = "/";
|
||||
break;
|
||||
case Key.NumPad0:
|
||||
case Key.D0:
|
||||
output = "0";
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
LogException(E);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user