ISEbd-11.Evtishina.E.V.03 #3

Closed
Evtishina_Elizaveta wants to merge 3 commits from LabWork03 into LabWork02
Showing only changes of commit adee094155 - Show all commits

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