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