Exemplo n.º 1
0
        public override string ToString()
        {
            string text = string.Empty;

            if (Ctrl)
            {
                text += "Ctrl + ";
            }
            if (Alt)
            {
                text += "Alt + ";
            }
            if (Shift)
            {
                text += "Shift + ";
            }
            if (Win)
            {
                text += "Win + ";
            }

            if (CharKey != Key.None)
            {
                text += specialSymbolDictionary.ContainsKey(CharKey)
                    ? specialSymbolDictionary[CharKey]
                    : CharKey.ToString();
            }
            else if (!string.IsNullOrEmpty(text))
            {
                text = text.Remove(text.Length - 3);
            }

            return(text);
        }
Exemplo n.º 2
0
        public override string ToString()
        {
            string text = string.Empty;

            if (Ctrl)
            {
                text += "Ctrl";
            }
            if (Alt)
            {
                text += string.IsNullOrEmpty(text) ? "Alt" : " + Alt";
            }
            if (Shift)
            {
                text += string.IsNullOrEmpty(text) ? "Shift" : " + Shift";
            }
            if (Win)
            {
                text += string.IsNullOrEmpty(text) ? "Win" : " + Win";
            }
            if (!string.IsNullOrEmpty(CharKey.ToString()))
            {
                text += string.IsNullOrEmpty(text) ? CharKey.ToString() : " + " + CharKey;
            }

            return(text);
        }
Exemplo n.º 3
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            if (Ctrl)
            {
                sb.Append("Ctrl + ");
            }
            if (Shift)
            {
                sb.Append("Shift + ");
            }
            if (Alt)
            {
                sb.Append("Alt + ");
            }
            if (Win)
            {
                sb.Append("Win + ");
            }
            if (CharKey != Key.None)
            {
                if (CharKey == Key.Space)
                {
                    sb.Append("Space");
                }
                else
                {
                    sb.Append(CharKey.ToString());
                }
            }
            else
            {
                sb.Remove(sb.Length - 3, 3);
            }
            return(sb.ToString());
        }