public void Resize(int newSize) { int count = this.Count; if (newSize < count) { this.RemoveRange(newSize, count - newSize); } else if (newSize > count) { this.InsertRange(count, (IListSource <T>)ListExt.Repeat(default(T), newSize - count)); } }