Added button to start all Runners.

This commit is contained in:
ruri
2019-04-16 19:31:46 +02:00
parent e238d9724a
commit 4b7fdfb665
2 changed files with 16 additions and 0 deletions
+6
View File
@@ -26,6 +26,12 @@
<TextBlock VerticalAlignment="Center" Margin="5 0">New</TextBlock>
</StackPanel>
</Button>
<Button x:Name="startAllRunnersButton" Click="startAllRunnersButton_Click">
<StackPanel Orientation="Horizontal">
<Image Source="/Images/Icons/play.png" Width="20" />
<TextBlock VerticalAlignment="Center" Margin="5 0">Start All</TextBlock>
</StackPanel>
</Button>
<Button x:Name="stopAllRunnersButton" Click="stopAllRunnersButton_Click">
<StackPanel Orientation="Horizontal">
<Image Source="/Images/Icons/stop.png" Width="20" />
@@ -156,5 +156,15 @@ namespace OpenBullet
}
}
}
private void startAllRunnersButton_Click(object sender, RoutedEventArgs e)
{
foreach (var runner in vm.Runners.Where(r => !r.Runner.Busy))
{
StartRunner += runner.Page.OnStartRunner;
OnStartRunner();
StartRunner -= runner.Page.OnStartRunner;
}
}
}
}