/// <summary> /// Updates the internal start and end positions with the current selection on the textbox. </summary> /// <seealso cref="Disable" /> public void Update() { if (textBox != null) { selection.Get(out this.start, out this.end); } }
/// <summary> /// Initializes a new instance of the Saver class by associating it with a TextBox derived object. </summary> /// <param name="textBox"> /// The TextBox object for which the selection is being saved. </param> /// <remarks> /// This constructor saves the textbox's start and end position of the selection inside private fields. </remarks> /// <seealso cref="System.Windows.Forms.TextBox" /> public Saver(TextBox textBox) { this.textBox = textBox; selection = new Selection(textBox); selection.Get(out this.start, out this.end); }