public ChangeNumberDialog(NumberBlock block, Int32 min, Int32 max) { if (block == null) { throw new ArgumentNullException("block"); } if (min > max) { throw new ArgumentException("Min must not be greater than max.", "max"); } this.block = block; this.min = min; this.max = max; InitializeComponent(); valueTextBox.MaxLength = Math.Max(min.ToString().Length, max.ToString().Length); valueTextBox.Text = block.Value.ToString(); valueTextBox.KeyDown += new KeyEventHandler(HitEnterKey); }
/// <summary> /// Gets whether a given Moveable represents a number value or variable. /// </summary> /// <param name="moveable">The Moveable to check.</param> /// <returns>True if the Moveable is a number; false otherwise.</returns> public static bool IsNumber(Moveable moveable) { NumberBlock numberBlock = moveable as NumberBlock; return numberBlock != null; }
public bool Equals(NumberBlock other) { return(other != null && other.Value == Value); }
public ChangeNumberDialog(NumberBlock block) : this(block, Int32.MinValue, Int32.MaxValue) { }