Esempio n. 1
0
        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);
        }
Esempio n. 2
0
		/// <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;
		}
Esempio n. 3
0
 public bool Equals(NumberBlock other)
 {
     return(other != null && other.Value == Value);
 }
Esempio n. 4
0
 public ChangeNumberDialog(NumberBlock block) : this(block, Int32.MinValue, Int32.MaxValue)
 {
 }