Esempio n. 1
0
 public GeneralSettings(DisplayLanguageSetting language, HotkeySetting[] hotkeySettings, bool autoSaveEnabled, int autoSavePeriod)
 {
     Language = language;
     HotkeySettings = hotkeySettings;
     AutoSaveEnabled = autoSaveEnabled;
     AutoSavePeriod = autoSavePeriod;
 }
Esempio n. 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);
 }
Esempio n. 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);
     }
 }