PIbd-11 Levchenko G.A. LabWork04 Base #4

Closed
Geo7312 wants to merge 2 commits from LabWork04 into LabWork03
Showing only changes of commit f03a770514 - 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>
/// Конструктор