GuOrg / Gu.Wpf.NumericInput

MIT License
74 stars 20 forks source link

IncrementStrategy #19

Open JohanLarsson opened 8 years ago

JohanLarsson commented 8 years ago
JohanLarsson commented 7 years ago
/// <summary>
/// Controls how increment and decrement behaves.
/// </summary>
public enum IncrementMode
{
    /// <summary>
    /// Truncate to the limit if overflow would have happened.
    /// </summary>
    Truncate,

    /// <summary>
    /// Add the increment even if it overflows the limit.
    /// </summary>
    Overflow,

    /// <summary>
    /// Don't allow incrementing if the limit would be overflown.
    /// </summary>
    DisableIfOverflow,
}
milleniumbug commented 7 years ago
JohanLarsson commented 7 years ago

BoundaryPolicy is nice, thanks!

/// <summary>
/// Controls how increment and decrement behaves.
/// </summary>
public enum BoundaryPolicy
{
    /// <summary>
    /// Truncate to the limit if overflow would have happened.
    /// </summary>
    Truncate,

    /// <summary>
    /// Add the increment even if it overflows the limit.
    /// </summary>
    Overflow,

    /// <summary>
    /// Don't allow incrementing or decrementing if the limit would be overflown.
    /// </summary>
    Disable,
}