/// <summary>
        /// 触发一个ShownOnContext事件,让订阅ShownOnContext事件的用户决定此控件的表现方式
        /// </summary>
        /// <param name="targets"></param>
        public void OnContextMenuStripOpening(IEnumerable targets)
        {
            //backup original state
            this.EnabledOrg   = Enabled;
            this.AvailableOrg = Available;
            ApplyControlOption(targets);
            var h = Showing;

            if (h != null)
            {
                var eventArgs = new StripMenuItemShownOnContextEventArgs(targets);
                h(this, eventArgs);
                if (eventArgs.Available.HasValue)
                {
                    this.Available = eventArgs.Available.Value;
                }
                else
                {
                    this.Available = true;
                }
                if (eventArgs.Enabled.HasValue)
                {
                    Enabled = eventArgs.Enabled.Value;
                }
                else
                {
                    Enabled = true;
                }
            }
        }
 /// <summary>
 /// 触发一个ShownOnContext事件,让订阅ShownOnContext事件的用户决定此控件的表现方式
 /// </summary>
 /// <param name="targets"></param>
 public void OnContextMenuStripOpening(IEnumerable targets)
 {
     //backup original state
     this.EnabledOrg = Enabled;
     this.AvailableOrg = Available;
     ApplyControlOption(targets);
     var h = Showing;
     if (h != null)
     {
         var eventArgs = new StripMenuItemShownOnContextEventArgs(targets);
         h(this, eventArgs);
         if (eventArgs.Available.HasValue)
         {
             this.Available = eventArgs.Available.Value;
         }
         else
         {
             this.Available = true;
         }
         if (eventArgs.Enabled.HasValue)
         {
             Enabled = eventArgs.Enabled.Value;
         }
         else
         {
             Enabled = true;
         }
     }
 }