public int AddAltItem(int AID) { TAltSelectorItem Item; int m_parentId = 0; int m_max = 0; bool m_ex = false; if (AID == 0) { return(0); // первая альтернатива особенная } for (int i = f_List.Count - 1; i >= 0; i--) { Item = (TAltSelectorItem)(f_List.ElementAt(i)); if (Item.ID == AID) { m_ex = true; m_parentId = Item.ParentShapeID; if (m_max < Item.Num) { m_max = Item.Num; } } } if (m_ex) { m_max++; Item = new TAltSelectorItem(AID, m_max, m_parentId); f_List.Add(Item); return(m_max); } return(-1); }
public TAltSelectorItem CreateNewAlternateID(int AParentShapeID, int AStartNum = 0) { TAltSelectorItem Item; Item = new TAltSelectorItem(f_Id, AStartNum, AParentShapeID); f_List.Add(Item); f_Id++; // первая альтернатива это особенная return(Item); }