コード例 #1
0
 /// <summary>
 /// Close the menu when the user clicked elsewhere
 /// </summary>
 private void OnDeactivate(object sender, EventArgs eventArgs)
 {
     // close if the new active windows isn't a menu
     // ReSharper disable once ObjectCreationAsStatement
     new DelayedAction(30, () => {
         if (!ListOfOpenededMenuHandle.Contains(WinApi.GetForegroundWindow()) && !_closing)
         {
             BeginInvoke((Action)CloseAll);
         }
     });
 }
コード例 #2
0
ファイル: YamuiWaterfallMenu.cs プロジェクト: zhitian/3P
 /// <summary>
 /// Close the menu when the user clicked elsewhere
 /// </summary>
 protected override void OnDeactivate(EventArgs e)
 {
     // close if the new active windows isn't a menu
     DelayedAction.StartNew(30, () => {
         if (!ListOfOpenededMenuHandle.Contains(WinApi.GetForegroundWindow()) && !_closing)
         {
             BeginInvoke((Action)CloseAll);
         }
     });
     base.OnDeactivate(e);
 }