Merge branch 'LabWork03' into LabWork04

This commit is contained in:
elizaveta 2024-05-08 14:29:46 +04:00
commit 7f0700010a

View File

@ -15,7 +15,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>
/// Конструктор