60 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			60 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
using System;
 | 
						|
using System.Text;
 | 
						|
 | 
						|
namespace DevComponents.DotNetBar.Events
 | 
						|
{
 | 
						|
    /// <summary>
 | 
						|
    /// Represents event arguments that provide information on source of action.
 | 
						|
    /// </summary>
 | 
						|
    public class EventSourceArgs : EventArgs
 | 
						|
    {
 | 
						|
        /// <summary>
 | 
						|
        /// Gets the source of the event.
 | 
						|
        /// </summary>
 | 
						|
        public readonly eEventSource Source = eEventSource.Code;
 | 
						|
 | 
						|
        /// <summary>
 | 
						|
        /// Initializes a new instance of the EventSourceArgs class.
 | 
						|
        /// </summary>
 | 
						|
        /// <param name="source"></param>
 | 
						|
        public EventSourceArgs(eEventSource source)
 | 
						|
        {
 | 
						|
            Source = source;
 | 
						|
        }
 | 
						|
    }
 | 
						|
 | 
						|
    /// <summary>
 | 
						|
    /// Delegate for the CancelableEventSource event.
 | 
						|
    /// </summary>
 | 
						|
    public delegate void CancelableEventSourceHandler(object sender, CancelableEventSourceArgs e);    
 | 
						|
    /// <summary>
 | 
						|
    /// Represents event arguments that provide information on source of action and allow canceling of action.
 | 
						|
    /// </summary>
 | 
						|
    public class CancelableEventSourceArgs : EventSourceArgs
 | 
						|
    {
 | 
						|
        /// <summary>
 | 
						|
        /// Gets or sets whether event action will be canceled.
 | 
						|
        /// </summary>
 | 
						|
        public bool Cancel = false;
 | 
						|
 | 
						|
        /// <summary>
 | 
						|
        /// Initializes a new instance of the EventSourceArgs class.
 | 
						|
        /// </summary>
 | 
						|
        /// <param name="source"></param>
 | 
						|
        public CancelableEventSourceArgs(eEventSource source)
 | 
						|
            : base(source)
 | 
						|
        {
 | 
						|
        }
 | 
						|
 | 
						|
        /// <summary>
 | 
						|
        /// Initializes a new instance of the CancelableEventSourceArgs class.
 | 
						|
        /// </summary>
 | 
						|
        /// <param name="cancel"></param>
 | 
						|
        public CancelableEventSourceArgs(eEventSource source, bool cancel)
 | 
						|
            : base(source)
 | 
						|
        {
 | 
						|
            Cancel = cancel;
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 |