public void Select(Selection selection)
 {
     int start = GetTrimmedValue(selection.Start, 0, Text.Length);
     int length = GetTrimmedValue(selection.Length, 0, Text.Length - start);
     m_Selection = new Selection(start, length);
 }
 protected internal TextBoxMemento(string text, int caretPostition, Selection selection)
 {
     m_Text = text;
     m_CaretPostition = caretPostition;
     m_Selection = selection;
     s_UniqueIdCounter++;
     m_UniqueId = s_UniqueIdCounter;
 }