/// <summary> /// Initializes a new instance of the DateTimeBehavior class by copying it from /// another DateTimeBehavior object. </summary> /// <param name="behavior"> /// The DateTimeBehavior 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 DateTimeBehavior(DateTimeBehavior behavior) : base(behavior) { m_dateBehavior = new DateBehavior(m_textBox, false); // does not add the event handlers }
/// <summary> /// Initializes a new instance of the DateTimeBehavior class by associating it with a TextBoxBase derived object. </summary> /// <param name="textBox"> /// The TextBoxBase object to associate with this behavior. It must not be null. </param> /// <exception cref="ArgumentNullException">textBox is null. </exception> /// <remarks> /// This constructor retrieves many of the properties from the user's system. </remarks> /// <seealso cref="System.Windows.Forms.TextBoxBase" /> public DateTimeBehavior(TextBoxBase textBox) : base(textBox) { m_dateBehavior = new DateBehavior(textBox, false); // does not add the event handlers m_flags |= m_dateBehavior.Flags; m_hourStart = 11; }
/// <summary> /// Initializes a new instance of the DateTextBox class by explicitly assigning its Behavior field. </summary> /// <param name="behavior"> /// The <see cref="DateBehavior" /> object to associate the textbox with. </param> public DateTextBox(DateBehavior behavior) : base(behavior) { }
/// <summary> /// Initializes a new instance of the DateBehavior class by copying it from /// another DateBehavior object. </summary> /// <param name="behavior"> /// The DateBehavior 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 DateBehavior(DateBehavior behavior) : base(behavior) { m_rangeMin = behavior.m_rangeMin; m_rangeMax = behavior.m_rangeMax; m_separator = behavior.m_separator; }
/// <summary> /// Initializes a new instance of the DateTextBox class by assigning its Behavior field /// to an instance of <see cref="DateBehavior" />. </summary> public DateTextBox() { m_behavior = new DateBehavior(this); }