public MyCollection() { Last = null; First = null; Next = null; CountInArray = 0; }
public void Add(T item) { try { if (CountInArray == 100) { throw new Exception("слышь? Хватит уже"); } if (First == null) { First = new NodeForMyCollection <T>(item); Last = First; CountInArray++; Added?.Invoke("добавилось"); } else { Last = new NodeForMyCollection <T>(item, Last); CountInArray++; Added("добавилось"); } } catch (Exception e) { Console.WriteLine(e.Message); } }
public void Clear() { Last = null; First = null; CountInArray = 0; Cleared("очищено"); }
public void SetPrevious(NodeForMyCollection <T> objNext) { Previous = objNext; }
public void SetNext(NodeForMyCollection <T> objNext) { Next = objNext; }
public NodeForMyCollection(T objT, NodeForMyCollection <T> objT2) { Value = objT; Previous = objT2; Next = null; objT2.SetNext(this); }
public NodeForMyCollection(T objT) { Value = objT; Previous = null; Next = null; }