Переделал установку максимального значения
This commit is contained in:
parent
66e147bd3a
commit
6e23967d26
@ -20,7 +20,7 @@ public class ListGenericObjects<T> : ICollectionGenericObjects<T>
|
|||||||
private readonly List<T?> _collection;
|
private readonly List<T?> _collection;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Максимальо допустимое число объектов в списке
|
/// Максимально допустимое число объектов в списке
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private int _maxCount;
|
private int _maxCount;
|
||||||
|
|
||||||
|
@ -20,8 +20,23 @@ public class MassiveGenericObjects<T> : ICollectionGenericObjects<T>
|
|||||||
|
|
||||||
public int Count => _collection.Length;
|
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>
|
/// <summary>
|
||||||
/// Конструктор
|
/// Конструктор
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -108,7 +108,6 @@ public class DrawingTrain
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool SetPictureSize(int width, int height)
|
public bool SetPictureSize(int width, int height)
|
||||||
{
|
{
|
||||||
//TODO!
|
|
||||||
if (_drawingMonorailWidth <= width && _drawingMonorailHeight <= height)
|
if (_drawingMonorailWidth <= width && _drawingMonorailHeight <= height)
|
||||||
{
|
{
|
||||||
_pictureWidth = width;
|
_pictureWidth = width;
|
||||||
|
Loading…
Reference in New Issue
Block a user