Esempio n. 1
0
        protected virtual void OnProjectMenuClick(ProjectMenuEventArgs e)
        {
            EventHandler <ProjectMenuEventArgs> de = (EventHandler <ProjectMenuEventArgs>)ProjectMenuClickAction;

            if (de != null)
            {
                de(this, e);
            }
        }
Esempio n. 2
0
 protected override void OnMouseDoubleClick(MouseEventArgs e)
 {
     base.OnMouseDoubleClick(e);
     if (HoverIndex >= 0)
     {
         if (!FavoriteHover)
         {
             string businessid = (string.IsNullOrEmpty(BusinessIdMember)) ? "" : FilterItemOnProperty(il[HoverIndex], businessidmember.BindingField).ToString();
             ProjectMenuEventArgs projectmenuEA = new ProjectMenuEventArgs(2, HoverIndex, businessid, (string.IsNullOrEmpty(DisplayMember)) ? "" : FilterItemOnProperty(il[HoverIndex], DisplayMember).ToString(), (string.IsNullOrEmpty(CommentMember)) ? "" : FilterItemOnProperty(il[HoverIndex], commentMember.BindingField).ToString());
             OnProjectMenuClick(projectmenuEA);
         }
     }
 }
Esempio n. 3
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            iskeydown = true;
            switch (e.KeyCode)
            {
            case Keys.Left:
            case Keys.Up:
                if (SelectedIndex > 0)
                {
                    SelectedIndex -= 1;
                }
                if (SelectedIndex >= 0)
                {
                    ProjectMenuEventArgs projectmenuEA = new ProjectMenuEventArgs(5, SelectedIndex, "", (string.IsNullOrEmpty(DisplayMember)) ? "" : FilterItemOnProperty(il[SelectedIndex], DisplayMember).ToString(), (string.IsNullOrEmpty(CommentMember)) ? "" : FilterItemOnProperty(il[SelectedIndex], commentMember.BindingField).ToString());
                    OnProjectMenuClick(projectmenuEA);
                }
                break;

            case Keys.Right:
            case Keys.Down:
                if (SelectedIndex < items.Count - 1)
                {
                    SelectedIndex += 1;
                }
                if (SelectedIndex >= 0)
                {
                    ProjectMenuEventArgs projectmenuEA = new ProjectMenuEventArgs(5, SelectedIndex, "", (string.IsNullOrEmpty(DisplayMember)) ? "" : FilterItemOnProperty(il[SelectedIndex], DisplayMember).ToString(), (string.IsNullOrEmpty(CommentMember)) ? "" : FilterItemOnProperty(il[SelectedIndex], commentMember.BindingField).ToString());
                    OnProjectMenuClick(projectmenuEA);
                }
                break;

            case Keys.Enter:
                if (SelectedIndex >= 0)
                {
                    string businessid = (string.IsNullOrEmpty(BusinessIdMember)) ? "" : FilterItemOnProperty(il[SelectedIndex], businessidmember.BindingField).ToString();
                    ProjectMenuEventArgs projectmenuEA = new ProjectMenuEventArgs(0, SelectedIndex, businessid, (string.IsNullOrEmpty(DisplayMember)) ? "" : FilterItemOnProperty(il[SelectedIndex], DisplayMember).ToString(), (string.IsNullOrEmpty(CommentMember)) ? "" : FilterItemOnProperty(il[SelectedIndex], commentMember.BindingField).ToString());
                    OnProjectMenuClick(projectmenuEA);
                }
                break;
            }

            base.OnKeyDown(e);
        }
Esempio n. 4
0
 protected override void OnMouseMove(MouseEventArgs e)
 {
     if (!iskeydown)
     {
         HoverIndex    = IndexFromPoint(e.Location);
         FavoriteHover = FavoriteRect.Contains(e.Location);
         base.OnMouseMove(e);
         if (HoverIndex >= 0)
         {
             if (!FavoriteHover)
             {
                 string businessid = (string.IsNullOrEmpty(BusinessIdMember)) ? "" : FilterItemOnProperty(il[HoverIndex], businessidmember.BindingField).ToString();
                 ProjectMenuEventArgs projectmenuEA = new ProjectMenuEventArgs(4, HoverIndex, businessid, (string.IsNullOrEmpty(DisplayMember)) ? "" : FilterItemOnProperty(il[HoverIndex], DisplayMember).ToString(), (string.IsNullOrEmpty(CommentMember)) ? "" : FilterItemOnProperty(il[HoverIndex], commentMember.BindingField).ToString());
                 OnProjectMenuClick(projectmenuEA);
             }
         }
     }
     iskeydown = false;
 }
Esempio n. 5
0
        protected override void OnMouseClick(MouseEventArgs e)
        {
            base.OnMouseClick(e);
            if (HoverIndex >= 0)
            {
                string businessid = (string.IsNullOrEmpty(BusinessIdMember)) ? "" : FilterItemOnProperty(il[HoverIndex], businessidmember.BindingField).ToString();

                if (FavoriteHover)
                {
                    FavoriteEventArgs fEA = new FavoriteEventArgs(businessid.Trim(), (string.IsNullOrEmpty(DisplayMember)) ? "" : FilterItemOnProperty(il[HoverIndex], DisplayMember).ToString());
                    OnFavoriteClick(fEA);
                }
                else
                {
                    businessid = (string.IsNullOrEmpty(BusinessIdMember)) ? "" : FilterItemOnProperty(il[HoverIndex], businessidmember.BindingField).ToString();
                    ProjectMenuEventArgs projectmenuEA = new ProjectMenuEventArgs(1, HoverIndex, businessid, (string.IsNullOrEmpty(DisplayMember)) ? "" : FilterItemOnProperty(il[HoverIndex], DisplayMember).ToString(), (string.IsNullOrEmpty(CommentMember)) ? "" : FilterItemOnProperty(il[HoverIndex], commentMember.BindingField).ToString());
                    if (IsSingleClickUsed)
                    {
                        projectmenuEA.SelectType = 2;
                    }
                    OnProjectMenuClick(projectmenuEA);
                }
            }
        }