Skip to content

Commit

Permalink
add forgotten file, some cleanup, fix blocked keys autosave, fix bloc…
Browse files Browse the repository at this point in the history
…k for some keys
  • Loading branch information
igor-panteleev committed Aug 23, 2017
1 parent 97671a1 commit 7a36efe
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 45 deletions.
36 changes: 0 additions & 36 deletions Models/ShorcutSwitch.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Input;

namespace WinHook.Models
{
[Serializable]
//[TypeConverter(typeof(ShorcutSwitchConverter))]
public class ShorcutSwitch
{
//[TypeConverter(typeof(KeysConverter))]
public Keys Keys { get; set; }

//[TypeConverter(typeof(ModifierKeysConverter))]
public ModifierKeys ModifierKeys { get; set; }

public ShorcutSwitch(Keys keys, ModifierKeys modifierKeys)
Expand Down Expand Up @@ -52,32 +44,4 @@ public override string ToString()
return shortcutText.ToString();
}
}

//public class ShorcutSwitchConverter : TypeConverter
//{
// public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
// {
// return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType);
// }

// // Overrides the ConvertFrom method of TypeConverter.
// public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
// {
// if (!(value is string)) return base.ConvertFrom(context, culture, value);
// var v = ((string)value).Split('+');
// var keys = (Keys)TypeDescriptor.GetConverter(typeof(Keys)).ConvertFrom(v.Last());
// var a = string.Join("+", v.DropLast(1));
// var modifiersKeys = (ModifierKeys)TypeDescriptor.GetConverter(typeof(ModifierKeys)).ConvertFromInvariantString(a);
// return new ShorcutSwitch(keys, modifiersKeys);
// }
// // Overrides the ConvertTo method of TypeConverter.
// public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
// {
// if (destinationType == typeof(string))
// {
// return value == null ? "" : value.ToString();
// }
// return base.ConvertTo(context, culture, value, destinationType);
// }
//}
}
3 changes: 0 additions & 3 deletions Utils/DropLast.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WinHook.Utils
{
Expand Down
5 changes: 0 additions & 5 deletions Utils/HotKeyManager.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Input;

Expand Down
1 change: 0 additions & 1 deletion ViewModels/WinHookViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.IO;
using System.Linq;
using System.Windows;
using System.Windows.Input;
using System.Xml.Serialization;
using WinHook.Models;
using WinHook.Utils;
Expand Down

0 comments on commit 7a36efe

Please sign in to comment.