/// <summary>
		/// Determines if the specified tool can be clicked
		/// </summary>
		/// <param name="tool"></param>
		/// <param name="args"></param>
		/// <returns></returns>
		public bool CanClick(object sender, MenuItem menuItem, params object[] args)
		{
			this.AssertValidMenuItem(menuItem);
	
			MenuItemCancelEventArgs e = new MenuItemCancelEventArgs(false, sender, menuItem, args);
			this.OnCanClickMenuItem(this, e);
			return !e.Cancel;
		}
示例#2
0
        /// <summary>
        /// Determines if the specified tool can be clicked
        /// </summary>
        /// <param name="tool"></param>
        /// <param name="args"></param>
        /// <returns></returns>
        public bool CanClick(object sender, MenuItem menuItem, params object[] args)
        {
            this.AssertValidMenuItem(menuItem);

            MenuItemCancelEventArgs e = new MenuItemCancelEventArgs(false, sender, menuItem, args);

            this.OnCanClickMenuItem(this, e);
            return(!e.Cancel);
        }
		/// <summary>
		/// Raises the CanClickMenuItem event
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void OnCanClickMenuItem(object sender, MenuItemCancelEventArgs e)
		{
			try
			{
				if (this.CanClickMenuItem != null)
					this.CanClickMenuItem(sender, e);
			}
			catch(System.Exception systemException)
			{
				System.Diagnostics.Debug.WriteLine(systemException);
			}
		}
示例#4
0
 /// <summary>
 /// Raises the CanClickMenuItem event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnCanClickMenuItem(object sender, MenuItemCancelEventArgs e)
 {
     try
     {
         if (this.CanClickMenuItem != null)
         {
             this.CanClickMenuItem(sender, e);
         }
     }
     catch (System.Exception systemException)
     {
         System.Diagnostics.Debug.WriteLine(systemException);
     }
 }