Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void fillCheckBox() // Uzupełniamy listę elementów
- {
- if (howManyItems == 0) return;
- int a = 0;
- for (int i = 0; i < howManyItems; i++)
- {
- if (GraphList[i].parent != 0) continue;
- maxTimeInSec += GraphList[i].seconds + GraphList[i].minutes * 60 + GraphList[i].hours * 3600 + GraphList[i].days * 24 * 3600;
- CheckedList.Add(new CheckBoxItem());
- CheckedList[a].owner = i;
- if (GraphList[i].name.Length <= 56)
- checkedListBox1.Items.Add("[" + a + "] " + GraphList[i].name);
- else checkedListBox1.Items.Add("[" + a + "] " + GraphList[i].name.Substring(0, 56));
- checkedListBox1.SetItemChecked(a, true);
- a++;
- }
- for (int i = 0; i < howManyItems; i++)
- {
- if (GraphList[i].parent != 0) continue;
- GraphList[i].realPercentOfParent = (GraphList[i].seconds + GraphList[i].minutes * 60 + GraphList[i].hours * 3600 + GraphList[i].days * 24 * 3600) * 100.0 / maxTimeInSec;
- }
- for (int i = 0; i < checkedListBox1.Items.Count; i++)
- {
- GraphList[CheckedList[i].owner].visible = checkedListBox1.GetItemChecked(i);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement