Esempio n. 1
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            //
            IIconHolder mv = IconHolder;

            if (mv != null)
            {
                mv.ClearIconSelection();
                mv.SetIconSelection(this);
            }
            this.IsSelected = true;
            this.Invalidate();
            //

            if (e.Button == MouseButtons.Right)
            {
                ContextMenu mnu = new ContextMenu();

                //
                OnCreateContextMenu(mnu, e.Location);
                //
                if (mnu.MenuItems.Count > 0)
                {
                    if (_mouseDownSender != null)
                    {
                        mnu.Show(_mouseDownSender, e.Location);
                    }
                    else
                    {
                        mnu.Show(this, e.Location);
                    }
                }
            }
        }
 public void Setup(IIconHolder iconHolder, bool isSelect)
 {
     this.icon.sprite                   = iconHolder.Icon;
     this.canvasGroup.alpha             = 1.0f;
     this.selectEffectCanvasGroup.alpha = isSelect ? 1.0f : 0.0f;
 }