Пример #1
0
        /// <summary>
        /// Binds the Send type Drop down list Filtering by Hotstring Type
        /// </summary>
        public void BindSendType()
        {
            if (m_HotStringValue == null)
            {
                return;
            }
            SelectedOptions <HotStringSendEnum> SendOptions = new SelectedOptions <HotStringSendEnum>();

            if (this.HotStringValue.type == hotstringType.Inline)
            {
                EnumRule <HotStringSendEnum> SendExclude = new EnumRule <HotStringSendEnum>();
                SendExclude.Add(HotStringSendEnum.None);

                SendTypes = HotstringSendMethodMap.Instance.ToBindingList(SendOptions, SendExclude);
            }
            else
            {
                SendTypes = HotstringSendMethodMap.Instance.ToBindingList(SendOptions);
            }
            ddlSend.DataSource = null;
            ddlSend.Items.Clear();

            ddlSend.DisplayMember = "DisplayValue";
            ddlSend.ValueMember   = "Key";
            ddlSend.DataSource    = SendTypes;


            if (ddlSend.Items.Count > 0)
            {
                ddlSend.SelectedIndex = 0;
                for (int i = 0; i < ddlSend.Items.Count; i++)
                {
                    AhkKeyMapAhkMapValue mv = (AhkKeyMapAhkMapValue)ddlSend.Items[i];
                    if (mv.Selected == true)
                    {
                        ddlSend.SelectedIndex = i;
                        break;
                    }
                }
            }
        }
 /// <summary>
 /// Creates a new instance
 /// </summary>
 /// <param name="keys">HashSet that contains the keys</param>
 /// <param name="Rules">The Rules to apply</param>
 public HotStringKeyExist(ref HashSet <string> keys, EnumRule <HotStringOptionsEnum> Rules)
     : base(ref keys)
 {
     this.m_rules = Rules;
 }