/// <summary>
		/// Determines if a window can be show, provides external listeners to block a window for whatever reason
		/// </summary>
		/// <param name="window">The window that will be show</param>
		/// <param name="args">An array of user defined arguments</param>
		/// <returns></returns>
		public bool CanShow(Form window, params object[] args)
		{
			this.AssertValidWindow(window);

			WindowCancelEventArgs e = new WindowCancelEventArgs(false, window, args);
			this.OnCanShowWindow(this, e);
			return !e.Cancel;		
		}
Example #2
0
        /// <summary>
        /// Determines if a window can be show, provides external listeners to block a window for whatever reason
        /// </summary>
        /// <param name="window">The window that will be show</param>
        /// <param name="args">An array of user defined arguments</param>
        /// <returns></returns>
        public bool CanShow(Form window, params object[] args)
        {
            this.AssertValidWindow(window);

            WindowCancelEventArgs e = new WindowCancelEventArgs(false, window, args);

            this.OnCanShowWindow(this, e);
            return(!e.Cancel);
        }
Example #3
0
 /// <summary>
 /// Raises the CanShowWindow event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnCanShowWindow(object sender, WindowCancelEventArgs e)
 {
     try
     {
         if (this.CanShowWindow != null)
         {
             this.CanShowWindow(sender, e);
         }
     }
     catch (System.Exception systemException)
     {
         System.Diagnostics.Debug.WriteLine(systemException);
     }
 }
		/// <summary>
		/// Raises the CanShowWindow event
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void OnCanShowWindow(object sender, WindowCancelEventArgs e)
		{
			try
			{
				if (this.CanShowWindow != null)
					this.CanShowWindow(sender, e);
			}
			catch(System.Exception systemException)
			{
				System.Diagnostics.Debug.WriteLine(systemException);
			}
		}