/// <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;
		}
Beispiel #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);
			}
		}
Beispiel #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);
     }
 }