diff --git a/Project_SelfPropelledArtilleryUnit/Project_SelfPropelledArtilleryUnit/CollectionGenericObjects/MassiveGenericObjects.cs b/Project_SelfPropelledArtilleryUnit/Project_SelfPropelledArtilleryUnit/CollectionGenericObjects/MassiveGenericObjects.cs index 9a9e03d..97833a8 100644 --- a/Project_SelfPropelledArtilleryUnit/Project_SelfPropelledArtilleryUnit/CollectionGenericObjects/MassiveGenericObjects.cs +++ b/Project_SelfPropelledArtilleryUnit/Project_SelfPropelledArtilleryUnit/CollectionGenericObjects/MassiveGenericObjects.cs @@ -12,7 +12,22 @@ public class MassiveGenericObjects : ICollectionGenericObjects { private T?[] _collection; 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]; + } + } + } + } public MassiveGenericObjects() diff --git a/Project_SelfPropelledArtilleryUnit/Project_SelfPropelledArtilleryUnit/FormSAUCollection.cs b/Project_SelfPropelledArtilleryUnit/Project_SelfPropelledArtilleryUnit/FormSAUCollection.cs index e22da97..1bc46b8 100644 --- a/Project_SelfPropelledArtilleryUnit/Project_SelfPropelledArtilleryUnit/FormSAUCollection.cs +++ b/Project_SelfPropelledArtilleryUnit/Project_SelfPropelledArtilleryUnit/FormSAUCollection.cs @@ -216,14 +216,6 @@ public partial class FormSAUCollection : Form } - private void maskedTextBox_MaskInputRejected(object sender, MaskInputRejectedEventArgs e) - { - - } - - private void labelCollectionName_Click(object sender, EventArgs e) - { - - } + } \ No newline at end of file