public override void SetCapacity(int capacity) { string[] newValues = new string[capacity]; if (_values != null) { Array.Copy(_values, 0, newValues, 0, Math.Min(capacity, _values.Length)); } _values = newValues; }