/// <summary> /// Initializes a new instance of the NumericBehavior class by copying it from /// another NumericBehavior object. </summary> /// <param name="behavior"> /// The NumericBehavior object to copied (and then disposed of). It must not be null. </param> /// <exception cref="ArgumentNullException">behavior is null. </exception> /// <remarks> /// After the behavior.TextBox object is copied, Dispose is called on the behavior parameter. </remarks> public NumericBehavior(NumericBehavior behavior) : base(behavior) { this.maxWholeDigits = behavior.maxWholeDigits; this.maxDecimalPlaces = behavior.maxDecimalPlaces; this.digitsInGroup = behavior.digitsInGroup; this.negativeSign = behavior.negativeSign; this.decimalPoint = behavior.decimalPoint; this.groupSeparator = behavior.groupSeparator; this.prefix = behavior.prefix; this.rangeMin = behavior.rangeMin; this.rangeMax = behavior.rangeMax; }
/// <summary> /// Initializes a new instance of the NumericTextBox class by assigning its Behavior field /// to an instance of <see cref="NumericBehavior" /> and setting the maximum number of digits /// allowed left and right of the decimal point. </summary> /// <param name="maxWholeDigits"> /// The maximum number of digits allowed left of the decimal point. /// If it is less than 1, it is set to 1.</param> /// <param name="maxDecimalPlaces"> /// The maximum number of digits allowed right of the decimal point. /// If it is less than 0, it is set to 0. </param> public NumericTextBox(int maxWholeDigits, int maxDecimalPlaces) { behavior = new NumericBehavior(this, maxWholeDigits, maxDecimalPlaces); }
/// <summary> /// Initializes a new instance of the NumericTextBox class by explicitly assigning its Behavior field. </summary> /// <param name="behavior"> /// The <see cref="NumericBehavior" /> object to associate the textbox with. </param> public NumericTextBox(NumericBehavior behavior) : base(behavior) { }
/// <summary> /// Initializes a new instance of the NumericTextBox class by assigning its Behavior field /// to an instance of <see cref="NumericBehavior" />. </summary> public NumericTextBox() { behavior = new NumericBehavior(this); }