コード例 #1
0
        private static General AddPropertyToGeneralSettings(General general, string propertyName, string propertyValue)
        {
            switch (propertyName)
            {
            case FileConstants.General.ICON_FONT:
                general.IconFont = propertyValue;
                break;

            case FileConstants.General.ICON_FONT_SIZE:
                general.IconFontSize = propertyValue.ToFloat();
                break;

            case FileConstants.General.ICON_SHAPE:
                general.IconShape = propertyValue;
                break;

            case FileConstants.General.SHOW_BALLOON_TIPS:
                general.ShowBalloonTips = Convert.ToBoolean(propertyValue);
                break;

            case FileConstants.General.LOADED_GLOBAL_HOTKEY:
                general.LoadedGlobalHotkey = GlobalHotkeyParser.ConvertToLoadedGlobalHotkey(propertyValue);
                break;
            }
            return(general);
        }
コード例 #2
0
 public static void SaveNewGlobalHotkey(LoadedSettings loadedSettings, GlobalHotkeyStruct globalHotkey)
 {
     if (globalHotkey.FirstModifierKey == ModifierKeys.None.ToString())
     {
         MessageBox.Show(Constants.HotkeyMessages.SelectGlobalHotkeyToSave,
                         Constants.HotkeyMessages.SelectGlobalHotkeyToSaveCaption,
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else if (CurrentHotkeyEqualsSavedHotkey(loadedSettings, globalHotkey.Hotkey, globalHotkey.FirstModifierKey, globalHotkey.SecondModifierKey))
     {
         return;
     }
     else
     {
         loadedSettings.General.LoadedGlobalHotkey.Hotkey =
             GlobalHotkeyParser.ConvertStringToKey(globalHotkey.Hotkey);
         loadedSettings.General.LoadedGlobalHotkey.FirstModifierKey =
             GlobalHotkeyParser.ConvertStringToModifierKeys(globalHotkey.FirstModifierKey);
         loadedSettings.General.LoadedGlobalHotkey.SecondModifierKey =
             GlobalHotkeyParser.ConvertStringToModifierKeys(globalHotkey.SecondModifierKey);
     }
 }