Example #1
0
        /// <summary>Combines the modifier and key to a shortcut.
        /// Changes Control;Shift;Alt;T to Control + Shift + Alt + T
        /// </summary>
        /// <param name="mod">The modifier.</param>
        /// <param name="key">The key.</param>
        /// <returns>A string representation of the modifier and key.</returns>
        public static string CombineShortcut(HotKey.ModifierKeys mod, Keys key)
        {
            string hotkey = "";

            foreach (HotKey.ModifierKeys a in new ParseModifier((int)mod))
            {
                hotkey += a + " + ";
            }

            if (hotkey.Contains(HotKey.ModifierKeys.None.ToString()))
            {
                hotkey = "";
            }
            hotkey += key.ToString();
            return(hotkey);
        }
Example #2
0
        /// <summary>Combines the modifier and key to a shortcut.
        /// Changes Control;Shift;Alt; to Control + Shift + Alt
        /// </summary>
        /// <param name="mod">The modifier.</param>
        /// <returns>A string representation of the modifier</returns>
        public static string CombineShortcut(HotKey.ModifierKeys mod)
        {
            string hotkey = "";

            foreach (HotKey.ModifierKeys a in new ParseModifier((int)mod))
            {
                hotkey += a + " + ";
            }

            if (hotkey.Contains(HotKey.ModifierKeys.None.ToString()))
            {
                hotkey = "";
            }
            if (hotkey.Trim().EndsWith("+"))
            {
                hotkey = hotkey.Trim().Substring(0, hotkey.Length - 1);
            }

            return(hotkey);
        }
Example #3
0
 /// <summary>Initializes this class.
 /// </summary>
 /// <param name="mod">the modifier to parse.</param>
 public ParseModifier(HotKey.ModifierKeys mod) : this((int)mod)
 {
 }