예제 #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);
        }
예제 #2
0
파일: Fitter.cs 프로젝트: KateHowland/flip
		/// <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;
		}
예제 #3
0
 public bool Equals(NumberBlock other)
 {
     return(other != null && other.Value == Value);
 }
예제 #4
0
 public ChangeNumberDialog(NumberBlock block) : this(block, Int32.MinValue, Int32.MaxValue)
 {
 }