public GeneralSettings(DisplayLanguageSetting language, HotkeySetting[] hotkeySettings, bool autoSaveEnabled, int autoSavePeriod)
 {
     Language = language;
     HotkeySettings = hotkeySettings;
     AutoSaveEnabled = autoSaveEnabled;
     AutoSavePeriod = autoSavePeriod;
 }
Beispiel #2
0
 private bool IsDuplicate(HotkeySetting candidate)
 {
     return(_settings.FirstOrDefault(
                s =>
                s.Key1 == candidate.Key1 &&
                s.Key2 == candidate.Key2 &&
                s.HasAltModifier == candidate.HasAltModifier &&
                s.HasCtrlModifier == candidate.HasCtrlModifier &&
                s.HasShiftModifier == candidate.HasShiftModifier) != null);
 }
Beispiel #3
0
 private static bool IsValid(HotkeySetting candidate)
 {
     //This feels a bit sleazy...
     try
     {
         // ReSharper disable once UnusedVariable
         var test = new Hotkey(new IntPtr(), candidate.ToString(), null);
         return(true);
     }
     catch
     {
         return(false);
     }
 }