So I have an event for when a ComboBox loses focus
The for loop inside there is making my app run slow.
I'm looking for a better way of setting my label to that data.
So I select the comboBox, pick one of the drives in that box, and the labels update.
I can't think of a way of doing that outside of this loop.
Suggestions?
Thanks (:
private void ComboUpdate(object sender, RoutedEventArgs e)
{
if (comboDrives.Text != null)
{
lblDriveName.Content = string.Format("({0}) Drive", comboDrives.Text);
// Run slow because of this..
for (int i = 0; i < DiskInformation.Get().Count; i++)
if (DiskInformation.Get()[i].DiskName == comboDrives.Text)
lblDriveStatus.Content = string.Format("{0} GB free of {1} GB",
DiskInformation.Get()[i].DiskFreeSpace,
DiskInformation.Get()[i].DiskSize);
}
}
The for loop inside there is making my app run slow.
I'm looking for a better way of setting my label to that data.
So I select the comboBox, pick one of the drives in that box, and the labels update.
I can't think of a way of doing that outside of this loop.
Suggestions?
Thanks (: