#nullable enable
using System.ComponentModel;
namespace Terminal.Gui;
#pragma warning disable CS1711
///
/// for events that convey changes to a property of type .
///
/// The type of the value that was part of the change being canceled.
///
/// Events that use this class can be cancellable. Where applicable, the property
/// should be set to
/// to prevent the state change from occurring.
///
public class CancelEventArgs : CancelEventArgs where T : notnull
{
/// Initializes a new instance of the class.
/// The current (old) value of the property.
/// The value the property will be set to if the event is not cancelled.
/// Whether the event should be canceled or not.
/// The type of the value for the change being canceled.
public CancelEventArgs (ref readonly T currentValue, ref T newValue, bool cancel = false) : base (cancel)
{
CurrentValue = currentValue;
NewValue = newValue;
}
/// The current value of the property.
public T CurrentValue { get; }
/// The value the property will be set to if the event is not cancelled.
public T NewValue { get; set; }
}