Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. public void fillCheckBox() // Uzupełniamy listę elementów
  2. {
  3. if (howManyItems == 0) return;
  4. int a = 0;
  5. for (int i = 0; i < howManyItems; i++)
  6. {
  7. if (GraphList[i].parent != 0) continue;
  8. maxTimeInSec += GraphList[i].seconds + GraphList[i].minutes * 60 + GraphList[i].hours * 3600 + GraphList[i].days * 24 * 3600;
  9. CheckedList.Add(new CheckBoxItem());
  10. CheckedList[a].owner = i;
  11. if (GraphList[i].name.Length <= 56)
  12. checkedListBox1.Items.Add("[" + a + "] " + GraphList[i].name);
  13. else checkedListBox1.Items.Add("[" + a + "] " + GraphList[i].name.Substring(0, 56));
  14.  
  15. checkedListBox1.SetItemChecked(a, true);
  16. a++;
  17. }
  18.  
  19. for (int i = 0; i < howManyItems; i++)
  20. {
  21. if (GraphList[i].parent != 0) continue;
  22. GraphList[i].realPercentOfParent = (GraphList[i].seconds + GraphList[i].minutes * 60 + GraphList[i].hours * 3600 + GraphList[i].days * 24 * 3600) * 100.0 / maxTimeInSec;
  23. }
  24.  
  25. for (int i = 0; i < checkedListBox1.Items.Count; i++)
  26. {
  27. GraphList[CheckedList[i].owner].visible = checkedListBox1.GetItemChecked(i);
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement