示例#1
0
        /// <summary>
        /// Gets if a map value exist for a <see cref="HotkeysEnum"/> value.
        /// </summary>
        /// <param name="this"><see cref="HotkeysEnum"/></param>
        /// <returns>
        /// True if a map value exist in the map for <paramref name="this"/>; Otherwise false.
        /// </returns>
        /// <remarks>
        /// When second keepress hotkey is created the value for the seccond key may be different then
        /// the value of the first key. This method get the second value from a map if it contained in the map.
        /// <seealso cref="GetKey2MapValue(HotkeysEnum)"/>
        /// <seealso cref="HotKey2Map"/>
        /// <seealso cref="mapItem"/>
        /// <seealso cref="HotkeysEnum"/>
        /// </remarks>
        /// <example>
        /// bool bValue = HotkeysEnum.Number0.Has2MapValue();
        /// </example>
        public static bool Has2MapValue(this HotkeysEnum @this)
        {
            string EnumName = @this.ToString();

            if (HotKey2Map.Instance.HasKey[EnumName])
            {
                return(true);
            }
            return(false);
        }
示例#2
0
        /// <summary>
        /// Gets a string that represents the value information of <see cref="mapItem"/> for
        /// the <see cref="HotkeysEnum"/> value.
        /// </summary>
        /// <param name="this"><see cref="HotkeysEnum"/></param>
        /// <returns>
        /// String of <see cref="mapItem"/> value
        /// </returns>
        /// <remarks>
        /// When second keepress hotkey is created the value for the seccond key may be different then
        /// the value of the first key. This method get the second value from a map if it contained in the map.
        /// <seealso cref="Has2MapValue(HotkeysEnum)"/>
        /// <seealso cref="HotKey2Map"/>
        /// <seealso cref="mapItem"/>
        /// <seealso cref="HotkeysEnum"/>
        /// </remarks>
        /// <example>
        /// string strValue = HotkeysEnum.Number0.GetKey2MapValue();
        /// </example>
        public static string GetKey2MapValue(this HotkeysEnum @this)
        {
            string EnumName = @this.ToString();

            if (HotKey2Map.Instance.HasKey[EnumName])
            {
                return(HotKey2Map.Instance[EnumName].value);
            }
            return(EnumName);
        }