PIbd-11 Levchenko G.A. Lab Work 05 Base #5

Closed
Geo7312 wants to merge 6 commits from LabWork05 into LabWork04
Showing only changes of commit 86b599f661 - Show all commits

View File

@ -14,7 +14,23 @@ public class MassiveGenericObjects<T> : ICollectionGenericObjects<T>
public int Count => _collection.Length;
public int SetMaxCount { set { if (value > 0) { _collection = new T?[value]; } } }
public int SetMaxCount
{
set
{
if (value > 0)
{
if (_collection.Length > 0)
{
Array.Resize(ref _collection, value);
}
else
{
_collection = new T?[value];
}
}
}
}
/// <summary>
/// Конструктор