fix possible IndexOutOfRangeException
This commit is contained in:
parent
3ca514e653
commit
298e8f34f4
4 changed files with 24 additions and 12 deletions
|
@ -74,10 +74,13 @@ namespace SafeExamBrowser.UserInterface.Desktop.Controls.ActionCenter
|
||||||
Grid.Background = Brushes.Gray;
|
Grid.Background = Brushes.Gray;
|
||||||
Task.Delay(100).ContinueWith((task) => Dispatcher.Invoke(() =>
|
Task.Delay(100).ContinueWith((task) => Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
var btn = WirelessNetworksStackPanel.Children[0] as NetworkButton;
|
if (WirelessNetworksStackPanel.Children.Count > 0)
|
||||||
if (btn != null)
|
|
||||||
{
|
{
|
||||||
btn.SetFocus();
|
var btn = WirelessNetworksStackPanel.Children[0] as NetworkButton;
|
||||||
|
if (btn != null)
|
||||||
|
{
|
||||||
|
btn.SetFocus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
|
@ -79,10 +79,13 @@ namespace SafeExamBrowser.UserInterface.Desktop.Controls.Taskbar
|
||||||
Button.Background = Brushes.LightGray;
|
Button.Background = Brushes.LightGray;
|
||||||
Task.Delay(100).ContinueWith((task) => Dispatcher.Invoke(() =>
|
Task.Delay(100).ContinueWith((task) => Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
var btn = WirelessNetworksStackPanel.Children[0] as NetworkButton;
|
if (WirelessNetworksStackPanel.Children.Count > 0)
|
||||||
if (btn != null)
|
|
||||||
{
|
{
|
||||||
btn.SetFocus();
|
var btn = WirelessNetworksStackPanel.Children[0] as NetworkButton;
|
||||||
|
if (btn != null)
|
||||||
|
{
|
||||||
|
btn.SetFocus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
|
@ -74,10 +74,13 @@ namespace SafeExamBrowser.UserInterface.Mobile.Controls.ActionCenter
|
||||||
Grid.Background = Brushes.Gray;
|
Grid.Background = Brushes.Gray;
|
||||||
Task.Delay(100).ContinueWith((task) => Dispatcher.Invoke(() =>
|
Task.Delay(100).ContinueWith((task) => Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
var btn = WirelessNetworksStackPanel.Children[0] as NetworkButton;
|
if (WirelessNetworksStackPanel.Children.Count > 0)
|
||||||
if (btn != null)
|
|
||||||
{
|
{
|
||||||
btn.SetFocus();
|
var btn = WirelessNetworksStackPanel.Children[0] as NetworkButton;
|
||||||
|
if (btn != null)
|
||||||
|
{
|
||||||
|
btn.SetFocus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
|
@ -79,10 +79,13 @@ namespace SafeExamBrowser.UserInterface.Mobile.Controls.Taskbar
|
||||||
Button.Background = Brushes.LightGray;
|
Button.Background = Brushes.LightGray;
|
||||||
Task.Delay(100).ContinueWith((task) => Dispatcher.Invoke(() =>
|
Task.Delay(100).ContinueWith((task) => Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
var btn = WirelessNetworksStackPanel.Children[0] as NetworkButton;
|
if (WirelessNetworksStackPanel.Children.Count > 0)
|
||||||
if (btn != null)
|
|
||||||
{
|
{
|
||||||
btn.SetFocus();
|
var btn = WirelessNetworksStackPanel.Children[0] as NetworkButton;
|
||||||
|
if (btn != null)
|
||||||
|
{
|
||||||
|
btn.SetFocus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue