fix AddRange
This commit is contained in:
parent
e0539969b3
commit
5d27ee38a7
@ -7,7 +7,9 @@ namespace ConsoleApp
|
|||||||
{
|
{
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
var oc = new ObservableList<int>();
|
||||||
|
|
||||||
|
oc.AddRange(new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }.AsEnumerable());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ namespace ObservableCollections.Internal
|
|||||||
{
|
{
|
||||||
this.array = ArrayPool<T>.Shared.Rent(1);
|
this.array = ArrayPool<T>.Shared.Rent(1);
|
||||||
this.length = 1;
|
this.length = 1;
|
||||||
|
this.array[0] = item;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloneCollection(IEnumerable<T> source)
|
public CloneCollection(IEnumerable<T> source)
|
||||||
@ -113,7 +114,7 @@ namespace ObservableCollections.Internal
|
|||||||
public void Add(T item) => throw new NotSupportedException();
|
public void Add(T item) => throw new NotSupportedException();
|
||||||
public void Clear() => throw new NotSupportedException();
|
public void Clear() => throw new NotSupportedException();
|
||||||
public bool Contains(T item) => throw new NotSupportedException();
|
public bool Contains(T item) => throw new NotSupportedException();
|
||||||
public void CopyTo(T[] dest, int destIndex) => array.CopyTo(dest, destIndex);
|
public void CopyTo(T[] dest, int destIndex) => Array.Copy(array, 0, dest, destIndex, count);
|
||||||
|
|
||||||
public IEnumerator<T> GetEnumerator()
|
public IEnumerator<T> GetEnumerator()
|
||||||
{
|
{
|
||||||
|
@ -114,7 +114,7 @@ namespace ObservableCollections.Internal
|
|||||||
public void Add(T item) => throw new NotSupportedException();
|
public void Add(T item) => throw new NotSupportedException();
|
||||||
public void Clear() => throw new NotSupportedException();
|
public void Clear() => throw new NotSupportedException();
|
||||||
public bool Contains(T item) => throw new NotSupportedException();
|
public bool Contains(T item) => throw new NotSupportedException();
|
||||||
public void CopyTo(T[] dest, int destIndex) => array.CopyTo(dest, destIndex);
|
public void CopyTo(T[] dest, int destIndex) => Array.Copy(array, 0, dest, destIndex, count);
|
||||||
|
|
||||||
public IEnumerator<T> GetEnumerator()
|
public IEnumerator<T> GetEnumerator()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user