예제 #1
0
        public int DeleteElementFromCondition(GBox Element)
        {
            int IndexOfElement = IDsForMatrix[Element.Element.ID];

            for (int i = 0; i < AmountOfelements; i++)
            {
                if (CondMatrix[IndexOfElement][i] != "")
                {
                    AmountOfLines--;
                    LineIDs.Remove(CondMatrix[IndexOfElement][i]);
                }
                CondMatrix[IndexOfElement][i] = "";
            }
            for (int j = 0; j < AmountOfelements; j++)
            {
                if (CondMatrix[j][IndexOfElement] != "")
                {
                    AmountOfLines--;
                    LineIDs.Remove(CondMatrix[j][IndexOfElement]);
                }
                CondMatrix[j][IndexOfElement] = "";
            }

            BoxIDs.Remove(Element.Element.ID);

            return(0);
        }
예제 #2
0
        public int AddElementInCondition(GBox Element)
        {
            AmountOfelements++;
            BoxIDs.Add(Element.Element.ID, Element);
            IDsForMatrix.Add(Element.Element.ID, AmountOfelements - 1);
            CondMatrix.Add(new List <string>(AmountOfelements));

            for (int i = 0; i < AmountOfelements - 1; i++)
            {
                CondMatrix[AmountOfelements - 1].Add("");
            }

            for (int i = 0; i < AmountOfelements; i++)
            {
                CondMatrix[i].Add("");
            }

            return(0);
        }