public void EditMode(DPercentTable editTable, int index)
 {
     editMode = true;
     for (int i = 0; i < editTable.startValues.Count; i++)
     {
         DPercentLine newLine = new DPercentLine();
         newLine.sendingForm = this;
         if (i == 0)
         {
             newLine.SetMin();
         }
         else
         {
             newLine.SetMinToValue(editTable.startValues.ElementAt(i));
         }
         if (i < editTable.results.Count)
         {
             newLine.addEffect(editTable.results.ElementAt(i));
         }
         newLine.SetMinToValue(editTable.startValues.ElementAt(i));
         if (i < editTable.startValues.Count - 1)
         {
             newLine.SetMaxToValue(editTable.startValues.ElementAt(i + 1) - 1);
         }
         else
         {
             newLine.SetMaxToValue(editTable.MaxVal);
         }
         tableIndex = index;
         lines.Add(newLine);
         RedrawLines();
     }
 }
 public void AddBlanksAndSave(List <int[]> gaps)
 {
     foreach (int[] i in gaps)
     {
         DPercentLine newLine = new DPercentLine();
         newLine.SetMinToValue(i[0]);
         newLine.SetMaxToValue(i[1]);
         newLine.addEffect("No effect");
         InsertLineAndSort(newLine);
     }
     RedrawLines();
     BuildTable();
 }
Пример #3
0
        private void addBlankButton_Click(object sender, EventArgs e)
        {
            foreach (int[] i in Gaps)
            {
                DPercentLine newLine = new DPercentLine();
                if (i[0] == 1)
                {
                    newLine.SetMin();
                }
                else
                {
                    newLine.SetMinToValue(i[0]);
                }

                newLine.SetMaxToValue(i[1]);
                newLine.addEffect("No Effect");
                sendingForm.InsertLineAndSort(newLine);
            }
            this.Close();
        }