Esempio n. 1
0
        public override ContextMenuStrip GetContextMenu(ItemContextMenuRequestEventArgs requestEventArgs)
        {
            var mnu = new RemoteMenu(DataContext);

            Utility.MarkDropDownForAutoDispose(mnu);
            return(mnu);
        }
Esempio n. 2
0
 private static void OnRemoteLabelMouseDown(object sender, MouseEventArgs e)
 {
     if(e.Button == MouseButtons.Right)
     {
         var item = (ToolStripItem)sender;
         var remote = (Remote)item.Tag;
         if(remote != null)
         {
             var menu = new RemoteMenu(remote);
             Utility.MarkDropDownForAutoDispose(menu);
             var parent = Utility.GetParentControl(item);
             var x = item.Bounds.X + e.X;
             var y = item.Bounds.Y + e.Y;
             menu.Show(parent, x, y);
         }
     }
 }