Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
Jonatan Nilsson | 7b49f60bc3 | |
Jonatan Nilsson | 3cc0d7fc7b | |
Jonatan Nilsson | d0d06f9880 | |
Jonatan Nilsson | d846f94cd7 | |
Jonatan Nilsson | 2468497dfe | |
Jonatan Nilsson | eda4064af3 |
|
@ -106,3 +106,4 @@ Generated_Code #added for RIA/Silverlight projects
|
|||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
.vs
|
||||
|
|
|
@ -1,8 +1,20 @@
|
|||
<Application x:Class="ProgramQueuer.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="clr-namespace:ProgramQueuer.Helpers"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
<ResourceDictionary>
|
||||
<FontFamily x:Key="FontAwesome">/Resources/fontawesome.otf#Font Awesome 5 Free</FontFamily>
|
||||
<FontFamily x:Key="FontAwesomeSolid">/Resources/fontawesome-solid.otf#Font Awesome 5 Free</FontFamily>
|
||||
<FontFamily x:Key="FixedSys">/Resources/fixedsys.ttf#Fixedsys Excelsior</FontFamily>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<ResourceDictionary Source="Monotone.Colors.xaml" />
|
||||
<ResourceDictionary Source="Monotone.Brushes.xaml" />
|
||||
<!--<ResourceDictionary Source="Monotone.MahApps.xaml" />-->
|
||||
<ResourceDictionary Source="Monotone.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Configuration;
|
|||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace ProgramQueuer
|
||||
{
|
||||
|
@ -12,5 +13,5 @@ namespace ProgramQueuer
|
|||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,24 +3,29 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="clr-namespace:ProgramQueuer.Helpers"
|
||||
xmlns:properties="clr-namespace:ProgramQueuer.Properties"
|
||||
Title="MainWindow"
|
||||
Title="Program Queuer"
|
||||
Closing="Window_Closing"
|
||||
AllowDrop="True"
|
||||
DragEnter="ListView_DragEnter" Drop="ListView_Drop"
|
||||
Loaded="Window_Loaded"
|
||||
Width="{Binding Path=width, Source={x:Static properties:Settings.Default}, Mode=TwoWay}"
|
||||
Height="{Binding Path=height, Source={x:Static properties:Settings.Default}, Mode=TwoWay}" Loaded="Window_Loaded" Icon="/ProgramQueuer;component/reports.ico">
|
||||
Height="{Binding Path=height, Source={x:Static properties:Settings.Default}, Mode=TwoWay}" Icon="logo.ico" StateChanged="Window_StateChanged">
|
||||
<Window.Resources>
|
||||
<converters:BoolToVisibility x:Key="boolToVisible" />
|
||||
<converters:BooleanInverter x:Key="BooleanInverter" />
|
||||
<converters:ValueConverterGroup x:Key="boolInvertedToVisible">
|
||||
<converters:BooleanInverter />
|
||||
<converters:BoolToVisibility />
|
||||
</converters:ValueConverterGroup>
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
<Grid x:Name="mainGrid">
|
||||
<Grid.Background>
|
||||
<SolidColorBrush Color="{DynamicResource BaseM2Color}" />
|
||||
</Grid.Background>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="{Binding Path=split_height, Source={x:Static properties:Settings.Default}, Mode=OneWay}" />
|
||||
<RowDefinition Height="9" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="9" />
|
||||
<RowDefinition Height="200" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
|
@ -28,20 +33,9 @@
|
|||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ListView x:Name="listPrograms" Margin="6 6 6 0" AllowDrop="True" ItemsSource="{Binding QueueList}" SelectionMode="Single">
|
||||
<ListView x:Name="listPrograms" Margin="8 8 0 8" AllowDrop="True" ItemsSource="{Binding QueueList}" SelectionMode="Single">
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<GridViewColumn Header="" Width="28">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Height="16" Width="16" Source="/ProgramQueuer;component/Resources/play.png" Visibility="{Binding Path=Working, Converter={StaticResource boolToVisible}}" />
|
||||
<Image Height="16" Width="16" Source="/ProgramQueuer;component/Resources/application.png" Visibility="{Binding Path=Finished, Converter={StaticResource boolInvertedToVisible}}" />
|
||||
<Image Height="16" Width="16" Source="/ProgramQueuer;component/Resources/accept.png" Visibility="{Binding Path=Finished, Converter={StaticResource boolToVisible}}" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
<GridViewColumn Header="File/Program" Width="{Binding Path=columnWidth1, Source={x:Static properties:Settings.Default}, Mode=TwoWay}">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
|
@ -49,47 +43,74 @@
|
|||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
<GridViewColumn Header="Options" Width="{Binding Path=columnWidth2, Source={x:Static properties:Settings.Default}, Mode=TwoWay}">
|
||||
<GridViewColumn Header="Status" Width="{Binding Path=columnWidth3, Source={x:Static properties:Settings.Default}, Mode=TwoWay}">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Margin="0 0 6 0" BorderBrush="Transparent" Background="Transparent" Visibility="{Binding Path=Working, Converter={StaticResource boolInvertedToVisible}}" Click="buttonRemove_Click">
|
||||
<Image Height="16" Width="16" Source="/ProgramQueuer;component/Resources/remove.png" />
|
||||
</Button>
|
||||
<Button Margin="0 0 6 0" BorderBrush="Transparent" Background="Transparent" Visibility="{Binding Path=Working, Converter={StaticResource boolToVisible}}" Click="buttonStopCurrent_Click">
|
||||
<Image Height="16" Width="16" Source="/ProgramQueuer;component/Resources/stop.png" />
|
||||
</Button>
|
||||
<!--<Button Margin="0 0 6 0" BorderBrush="Transparent" Background="Transparent">
|
||||
<Image Height="16" Width="16" Source="/ProgramQueuer;component/Resources/window.png" />
|
||||
</Button>-->
|
||||
<TextBlock Margin="0 0 8 0" Visibility="{Binding Path=Finished, Converter={StaticResource boolToVisible}}" FontFamily="{StaticResource FontAwesomeSolid}" Text="" Foreground="#17aa22" />
|
||||
<TextBlock Text="{Binding Status}" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
<GridViewColumn Header="Status" Width="{Binding Path=columnWidth3, Source={x:Static properties:Settings.Default}, Mode=TwoWay}">
|
||||
<GridViewColumn Header="Actions" Width="{Binding Path=columnWidth2, Source={x:Static properties:Settings.Default}, Mode=TwoWay}">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Status}" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button FontFamily="{StaticResource FontAwesomeSolid}" ToolTip="Remove this job" BorderThickness="0" FontSize="16" Padding="8 8" Visibility="{Binding Path=Working, Converter={StaticResource boolInvertedToVisible}}" Click="buttonRemove_Click"></Button>
|
||||
|
||||
<Border Visibility="{Binding Path=Finished, Converter={StaticResource boolInvertedToVisible}}">
|
||||
<Button FontFamily="{StaticResource FontAwesomeSolid}" ToolTip="Start this job immediately" BorderThickness="0" FontSize="16" Padding="8 8" Visibility="{Binding Path=Working, Converter={StaticResource boolInvertedToVisible}}" Click="buttonStartCurrent_Click"></Button></Border>
|
||||
|
||||
<Button FontFamily="{StaticResource FontAwesomeSolid}" ToolTip="Stop this job immediately" BorderThickness="0" FontSize="16" Padding="8 8" Visibility="{Binding Path=Working, Converter={StaticResource boolToVisible}}" Click="buttonStopCurrent_Click"></Button>
|
||||
|
||||
<Button FontFamily="{StaticResource FontAwesomeSolid}" ToolTip="Reset status and queue again" BorderThickness="0" FontSize="16" Padding="8 8" Visibility="{Binding Path=Finished, Converter={StaticResource boolToVisible}}" Click="buttonResetCurrent_Click"></Button>
|
||||
|
||||
<Button FontFamily="{StaticResource FontAwesomeSolid}" ToolTip="Mark as finished" BorderThickness="0" FontSize="16" Padding="8 8" Visibility="{Binding Path=Finished, Converter={StaticResource boolInvertedToVisible}}" Click="buttonMarkFinishedCurrent_Click"></Button>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
<StackPanel Grid.Column="1">
|
||||
<Button Margin="0 6 6 6" BorderBrush="Transparent" Background="Transparent" Visibility="{Binding Path=Working, Converter={StaticResource boolInvertedToVisible}}" Click="buttonAdd_Click">
|
||||
<Image Height="16" Width="16" Source="/ProgramQueuer;component/Resources/add.png" />
|
||||
</Button>
|
||||
<StackPanel Grid.Column="1" Orientation="Vertical" Margin="0 8 8 8">
|
||||
<Button FontFamily="{StaticResource FontAwesomeSolid}" Click="buttonAdd_Click" ToolTip="Add a Program to the batch" BorderThickness="0" FontSize="20" Padding="16"></Button>
|
||||
<Button x:Name="buttonEmpty" Click="buttonClear_Click" FontFamily="{StaticResource FontAwesomeSolid}" ToolTip="Clear list" BorderThickness="0" FontSize="20" Padding="16"></Button>
|
||||
<Popup HorizontalOffset="-180" VerticalOffset="0" Width="250" Height="Auto" x:Name="popupEmpty" PlacementTarget="{Binding ElementName=buttonEmpty}" StaysOpen="False">
|
||||
<Border BorderBrush="{DynamicResource LighterBaseBrush}" BorderThickness="1">
|
||||
<StackPanel>
|
||||
<Button Click="buttonClearFinished_Click">Remove Finished Entries</Button>
|
||||
<Button Click="buttonClearAll_Click" IsEnabled="{Binding Path=Working, Converter={StaticResource BooleanInverter}}">Remove All Entries</Button>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Popup>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<GridSplitter ResizeDirection="Rows" Grid.Row="1" BorderThickness="1" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" DragCompleted="GridSplitter_DragCompleted" />
|
||||
<GroupBox Grid.Row="2" Margin="6 0 6 6" Header="Output" Padding="0 3 0 0">
|
||||
<TextBox x:Name="textboxStatus" AcceptsReturn="True" IsReadOnly="True" Background="Black" Foreground="White" Text="{Binding Path=SelectedItem.Output, ElementName=listPrograms}" TextChanged="TextBox_TextChanged" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" FontFamily="Fixedsys Excelsior 2.00">
|
||||
|
||||
</TextBox>
|
||||
</GroupBox>
|
||||
<Button x:Name="buttonExit" Grid.Row="3" HorizontalAlignment="Left" Margin="6 0 6 6" Width="120" Click="ButtonExit_Click">Close</Button>
|
||||
<Button x:Name="buttonStop" Grid.Row="3" HorizontalAlignment="Right" Margin="6 0 6 6" Width="120" Click="ButtonStop_Click" Visibility="{Binding Path=Working, Converter={StaticResource boolToVisible}}">Stop</Button>
|
||||
<Button x:Name="buttonWork" Grid.Row="3" HorizontalAlignment="Right" Margin="6 0 6 6" Width="120" Click="ButtonWork_Click" Visibility="{Binding Path=Working, Converter={StaticResource boolInvertedToVisible}}">Start</Button>
|
||||
<GridSplitter x:Name="gridSplitter" ResizeDirection="Rows" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" DragCompleted="GridSplitter_DragCompleted" />
|
||||
<Expander Margin="8" x:Name="expanderStatus" Grid.Row="2" ExpandDirection="Down" IsExpanded="True" Expanded="expanderStatus_Expanded" Collapsed="expanderStatus_Collapsed" Header="Output">
|
||||
<!--<Expander.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock>Output</TextBlock>
|
||||
<CheckBox x:Name="checkboxOverrideOutput" Margin="6 2 0 0" IsChecked="{Binding Path=RedirectOutput, Mode=TwoWay}" IsEnabled="{Binding Path=Working, Converter={StaticResource BooleanInverter}}" Checked="checkboxOverrideOutput_Checked" Unchecked="checkboxOverrideOutput_Unchecked">Override Console Window</CheckBox>
|
||||
<Button x:Name="buttonHelp" Margin="6 0 0 0" Cursor="Help" Visibility="{Binding Path=Working, Converter={StaticResource boolInvertedToVisible}}" Click="ButtonHelp_Click">
|
||||
What is this?
|
||||
</Button>
|
||||
<Popup HorizontalOffset="0" VerticalOffset="0" Width="350" Height="Auto" x:Name="popupHelp" PlacementTarget="{Binding ElementName=buttonHelp}" StaysOpen="False">
|
||||
<Border BorderBrush="{DynamicResource LighterBaseBrush}" BorderThickness="1">
|
||||
<TextBlock Margin="6" TextWrapping="Wrap">Controls whether the cmd (command line window) is displayed or not.<LineBreak /><LineBreak />If this is checked, ProgramQueuer will hide the window and transfer all output in the textbox below.<LineBreak /><LineBreak />If this is not checked, the original cmd window is displayed.</TextBlock>
|
||||
</Border>
|
||||
</Popup>
|
||||
</StackPanel>
|
||||
</Expander.Header>-->
|
||||
<ScrollViewer Background="Black" >
|
||||
<TextBox x:Name="textboxStatus" BorderThickness="0" AcceptsReturn="True" IsReadOnly="True" Text="{Binding Path=SelectedItem.Output, ElementName=listPrograms}" TextChanged="TextBox_TextChanged" FontFamily="{StaticResource FixedSys}">
|
||||
|
||||
</TextBox>
|
||||
</ScrollViewer>
|
||||
</Expander>
|
||||
<Button Margin="8 0 8 8" x:Name="buttonExit" Grid.Row="3" HorizontalAlignment="Left" Width="120" Click="ButtonExit_Click">Close</Button>
|
||||
<Button Margin="8 0 8 8" x:Name="buttonStop" Grid.Row="3" HorizontalAlignment="Right" Width="120" Click="ButtonStop_Click" Visibility="{Binding Path=Working, Converter={StaticResource boolToVisible}}">Stop</Button>
|
||||
<Button Margin="8 0 8 8" x:Name="buttonWork" Grid.Row="3" HorizontalAlignment="Right" Width="120" Click="ButtonWork_Click" Visibility="{Binding Path=Working, Converter={StaticResource boolInvertedToVisible}}">Start</Button>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
|
@ -11,8 +13,12 @@ using System.Windows.Media;
|
|||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Resources;
|
||||
using System.Windows.Threading;
|
||||
using ProgramQueuer.Queuer;
|
||||
using WPF.JoshSmith.ServiceProviders.UI;
|
||||
using Microsoft.Win32;
|
||||
using NotifyIcon = System.Windows.Forms.NotifyIcon;
|
||||
|
||||
namespace ProgramQueuer
|
||||
{
|
||||
|
@ -22,35 +28,73 @@ namespace ProgramQueuer
|
|||
public partial class MainWindow : Window
|
||||
{
|
||||
EntryManager _manager;
|
||||
OpenFileDialog _openFile;
|
||||
NotifyIcon _icon;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_manager = new EntryManager();
|
||||
_openFile = new OpenFileDialog { Filter = "All Files (*.*)|*.*",
|
||||
CheckFileExists = true,
|
||||
Multiselect = true,
|
||||
InitialDirectory = ProgramQueuer.Properties.Settings.Default.lastPath };
|
||||
this._icon = new NotifyIcon { Icon = Properties.Resources.program, Visible = true };
|
||||
this._icon.MouseClick += new System.Windows.Forms.MouseEventHandler(_icon_MouseClick);
|
||||
this.DataContext = _manager;
|
||||
this.listPrograms.ItemsSource = _manager.QueueList;
|
||||
mainGrid.RowDefinitions[2].Height = new GridLength(ProgramQueuer.Properties.Settings.Default.split_height);
|
||||
}
|
||||
|
||||
void _icon_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e)
|
||||
{
|
||||
this.Visibility = System.Windows.Visibility.Visible;
|
||||
Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background,
|
||||
new Action(delegate()
|
||||
{
|
||||
this.WindowState = WindowState.Normal;
|
||||
this.Activate();
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_manager.RedirectOutput = ProgramQueuer.Properties.Settings.Default.redirectOutput;
|
||||
_manager.Load();
|
||||
new ListViewDragDropManager<ProgramEntry>(this.listPrograms);
|
||||
}
|
||||
|
||||
private void GridSplitter_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
|
||||
{
|
||||
ProgramQueuer.Properties.Settings.Default.split_height = (int)((sender as GridSplitter).Parent as Grid).RowDefinitions[2].Height.Value;
|
||||
ProgramQueuer.Properties.Settings.Default.split_height = mainGrid.RowDefinitions[2].ActualHeight;
|
||||
}
|
||||
|
||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
if (_manager.Working)
|
||||
bool working = false;
|
||||
for (int i = 0; i < _manager.QueueList.Count; i++)
|
||||
{
|
||||
if (_manager.QueueList[i].Working)
|
||||
{
|
||||
working = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (working)
|
||||
if (MessageBox.Show("Are you sure you want to stop current worker and batch and exit application?", "You sure you want to exit?", MessageBoxButton.YesNo) == MessageBoxResult.No)
|
||||
{
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
ProgramQueuer.Properties.Settings.Default.Save();
|
||||
else
|
||||
_manager.ForceStop();
|
||||
this._icon.Visible = false;
|
||||
ProgramQueuer.Properties.Settings.Default.redirectOutput = _manager.RedirectOutput;
|
||||
ProgramQueuer.Properties.Settings.Default.lastPath = _openFile.InitialDirectory;
|
||||
_manager.Save();
|
||||
// ProgramQueuer.Properties.Settings.Default.Save();
|
||||
}
|
||||
|
||||
private void ButtonExit_Click(object sender, RoutedEventArgs e)
|
||||
|
@ -86,7 +130,9 @@ namespace ProgramQueuer
|
|||
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop, false);
|
||||
foreach (string file in files)
|
||||
{
|
||||
_manager.QueueList.Add(new ProgramEntry { Name = file , Status = "Queued"});
|
||||
_manager.AddToQueue(new ProgramEntry { Name = file , Status = "Queued"});
|
||||
_openFile.InitialDirectory = new FileInfo(file).DirectoryName;
|
||||
_manager.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -98,9 +144,19 @@ namespace ProgramQueuer
|
|||
|
||||
private void buttonStopCurrent_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (MessageBox.Show("Are you sure you want to stop current running process and continue to next?", "Stop current worker?", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
||||
if (_manager.CurrentEntry == ((sender as Control).DataContext as ProgramEntry))
|
||||
{
|
||||
_manager.ForceStopCurrent();
|
||||
if (MessageBox.Show("Are you sure you want to kill this process and continue with the next one available?", "Stop current process?", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
||||
{
|
||||
_manager.ForceStopEntry((sender as Control).DataContext as ProgramEntry);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (MessageBox.Show("Are you sure you want to kill this process?", "Stop selected process?", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
||||
{
|
||||
_manager.ForceStopEntry((sender as Control).DataContext as ProgramEntry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,7 +168,115 @@ namespace ProgramQueuer
|
|||
|
||||
private void buttonAdd_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_openFile.ShowDialog() == true)
|
||||
{
|
||||
foreach (string file in _openFile.FileNames)
|
||||
{
|
||||
_manager.AddToQueue(new ProgramEntry { Name = file, Status = "Queued" });
|
||||
_openFile.InitialDirectory = new FileInfo(file).DirectoryName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void checkboxOverrideOutput_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (textboxStatus != null)
|
||||
textboxStatus.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
private void checkboxOverrideOutput_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (textboxStatus != null)
|
||||
textboxStatus.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
private void ButtonHelp_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// popupHelp.IsOpen = true;
|
||||
}
|
||||
|
||||
private void buttonStartCurrent_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_manager.RunProgram((sender as Control).DataContext as ProgramEntry);
|
||||
}
|
||||
|
||||
private void buttonClear_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
popupEmpty.IsOpen = true;/*
|
||||
*/
|
||||
}
|
||||
|
||||
private void Window_StateChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (this.WindowState == System.Windows.WindowState.Minimized)
|
||||
{
|
||||
this.Visibility = System.Windows.Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonClearFinished_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
bool changed = false;
|
||||
for (int i = 0; i < _manager.QueueList.Count; i++)
|
||||
{
|
||||
if (_manager.QueueList[i].Finished == true)
|
||||
{
|
||||
changed = true;
|
||||
_manager.QueueList.Remove(_manager.QueueList[i]);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
if (changed)
|
||||
{
|
||||
_manager.Save();
|
||||
}
|
||||
popupEmpty.IsOpen = false;
|
||||
}
|
||||
|
||||
private void buttonClearAll_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
for (int i = 0; i < _manager.QueueList.Count; i++)
|
||||
{
|
||||
if (_manager.QueueList[i].Working)
|
||||
{
|
||||
MessageBox.Show("Cannot clear list while program are still in working mode. Please stop all running instances.", "Processes still running.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (MessageBox.Show("Are you sure you want to clear list?", "Clear list?", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
||||
{
|
||||
_manager.QueueList.Clear();
|
||||
_manager.Save();
|
||||
}
|
||||
popupEmpty.IsOpen = false;
|
||||
}
|
||||
|
||||
private void expanderStatus_Expanded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
mainGrid.RowDefinitions[2].Height = new GridLength(ProgramQueuer.Properties.Settings.Default.split_height);
|
||||
gridSplitter.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
private void expanderStatus_Collapsed(object sender, RoutedEventArgs e)
|
||||
{
|
||||
mainGrid.RowDefinitions[2].Height = new GridLength(0, GridUnitType.Auto);
|
||||
gridSplitter.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
private void buttonResetCurrent_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var entry = (sender as Control).DataContext as ProgramEntry;
|
||||
entry.Finished = false;
|
||||
entry.Status = "Queued";
|
||||
_manager.Save();
|
||||
}
|
||||
|
||||
private void buttonMarkFinishedCurrent_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var entry = (sender as Control).DataContext as ProgramEntry;
|
||||
entry.Finished = true;
|
||||
entry.Status = "Marked finished";
|
||||
_manager.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,196 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:ProgramQueuer">
|
||||
<sys:Double x:Key="DefaultBorderThicknessNumber">1</sys:Double>
|
||||
<Thickness x:Key="ButtonBorderThickness">1</Thickness>
|
||||
<Thickness x:Key="ToolbarBorderThickness">1</Thickness>
|
||||
<Thickness x:Key="DefaultBorderThickness">1</Thickness>
|
||||
<Thickness x:Key="ComboBoxBorderThickness">1</Thickness>
|
||||
|
||||
<!-- The Top value has to be the negative of the BorderThickness. By setting this the (selected) TabItem-Header will exactly overlap with the border -->
|
||||
<Thickness x:Key="TabTopContentPlacement" Top="-1"></Thickness>
|
||||
<Thickness x:Key="TabBottomContentPlacement" Bottom="-1"></Thickness>
|
||||
<Thickness x:Key="TabLeftContentPlacement" Left="-1"></Thickness>
|
||||
<Thickness x:Key="TabRightContentPlacement" Right="-1"></Thickness>
|
||||
<Thickness x:Key="TabHeaderTopThickness" Left="1" Top="1" Right="1"></Thickness>
|
||||
<Thickness x:Key="TabHeaderBottomThickness" Left="1" Right="1" Bottom="1"></Thickness>
|
||||
<Thickness x:Key="TabHeaderLeftThickness" Left="1" Top="1" Bottom="1"></Thickness>
|
||||
<Thickness x:Key="TabHeaderRightThickness" Top="1" Right="1" Bottom="1"></Thickness>
|
||||
<Thickness x:Key="TabHeaderTopThicknessInverted" Bottom="1"></Thickness>
|
||||
<Thickness x:Key="TabHeaderBottomThicknessInverted" Top="1"></Thickness>
|
||||
<Thickness x:Key="TabHeaderLeftThicknessInverted" Right="1"></Thickness>
|
||||
<Thickness x:Key="TabHeaderRightThicknessInverted" Left="1"></Thickness>
|
||||
|
||||
<CornerRadius x:Key="ButtonCornerRadius">1</CornerRadius>
|
||||
<CornerRadius x:Key="UpperInnerButtonCornerRadius">0</CornerRadius>
|
||||
<CornerRadius x:Key="LowerInnerButtonCornerRadius">0</CornerRadius>
|
||||
<CornerRadius x:Key="DefaultCornerRadius">1</CornerRadius>
|
||||
<CornerRadius x:Key="ComboBoxCornerRadius">2</CornerRadius>
|
||||
<CornerRadius x:Key="ComboBoxRightCornerRadius" TopRight="0" BottomRight="0"></CornerRadius>
|
||||
|
||||
<!-- Corner Radius for TabControl -->
|
||||
<CornerRadius x:Key="TabTopCornerRadius" TopRight="0" BottomLeft="0" BottomRight="0"></CornerRadius>
|
||||
<CornerRadius x:Key="TabBottomCornerRadius" TopLeft="0" TopRight="0" BottomRight="0"></CornerRadius>
|
||||
<CornerRadius x:Key="TabLeftCornerRadius" TopRight="0" BottomLeft="0" BottomRight="0"></CornerRadius>
|
||||
<CornerRadius x:Key="TabRightCornerRadius" TopLeft="0" BottomLeft="0" BottomRight="0"></CornerRadius>
|
||||
<!-- CornerRadius for TabItem -->
|
||||
<CornerRadius x:Key="TabTopHeaderCornerRadius" TopLeft="0" TopRight="0"></CornerRadius>
|
||||
<CornerRadius x:Key="TabBottomHeaderCornerRadius" BottomLeft="0" BottomRight="0"></CornerRadius>
|
||||
<CornerRadius x:Key="TabLeftHeaderCornerRadius" TopLeft="0" BottomLeft="0"></CornerRadius>
|
||||
<CornerRadius x:Key="TabRightHeaderCornerRadius" TopRight="0" BottomRight="0"></CornerRadius>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<SolidColorBrush Color="{DynamicResource BaseColor}" x:Key="BaseBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource Base2Color}" x:Key="LighterBaseBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource Base4Color}" x:Key="VeryLighterBaseBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource Base6Color}" x:Key="PopupBorderBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource BaseM2Color}" x:Key="DarkerBaseBrush" />
|
||||
<SolidColorBrush Color="{StaticResource TextColor}" x:Key="TextBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource Base2Color}" x:Key="BaseBorderBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource Base3TColor}" x:Key="SemiTransparentBaseBorderBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource ErrorColor}" x:Key="ErrorBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource DarkErrorColor}" x:Key="DarkerErrorBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource BaseM2TColor}" x:Key="SemiTransparentDarkerBaseBrush" />
|
||||
|
||||
<DropShadowEffect x:Key="ButtonHoverGlowEffect" BlurRadius="10" ShadowDepth="0" Color="Cyan" />
|
||||
<DropShadowEffect x:Key="ButtonPressedGlowEffect" BlurRadius="10" ShadowDepth="0" Color="DarkCyan" />
|
||||
<SolidColorBrush x:Key="ButtonGlowBrush" Color="Cyan" />
|
||||
<Thickness x:Key="GlowBorderThickness">10</Thickness>
|
||||
<Thickness x:Key="GlowBorderMargin">-11</Thickness>
|
||||
<Thickness x:Key="GlowBorderMargin2">-10</Thickness>
|
||||
|
||||
<LinearGradientBrush x:Key="ToolBarTrayBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
|
||||
<GradientStop Color="{DynamicResource Base2Color}" Offset="0" />
|
||||
<GradientStop Color="{DynamicResource BaseColor}" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<SolidColorBrush x:Key="ButtonBackgroundBrush" Color="Transparent" />
|
||||
<!--<LinearGradientBrush x:Key="ButtonBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
|
||||
<GradientStop Color="{DynamicResource Base3Color}" Offset="0" />
|
||||
<GradientStop Color="{DynamicResource BaseColor}" Offset="1" />
|
||||
</LinearGradientBrush>-->
|
||||
<LinearGradientBrush x:Key="ButtonBackgroundBrush90D" StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Color="{DynamicResource Base3Color}" Offset="0" />
|
||||
<GradientStop Color="{DynamicResource BaseColor}" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="TabItemHeaderBrush" StartPoint="0,0" EndPoint="0,1">
|
||||
<GradientStop Color="#111" Offset="0" />
|
||||
<GradientStop Color="{DynamicResource BaseM1Color}" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="HorizontalButtonBackgroundBrush" StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Color="{DynamicResource Base2Color}" Offset="1" />
|
||||
<GradientStop Color="{DynamicResource BaseColor}" Offset="0" />
|
||||
</LinearGradientBrush>
|
||||
<SolidColorBrush x:Key="ButtonBackgroundPressedBrush" Color="{DynamicResource SelectedColorLight}" />
|
||||
<!--<LinearGradientBrush x:Key="ButtonBackgroundPressedBrush" StartPoint="0,0" EndPoint="0,1">
|
||||
<GradientStop Color="{DynamicResource BaseColor}" Offset="0" />
|
||||
<GradientStop Color="{DynamicResource Base3Color}" Offset="1" />
|
||||
</LinearGradientBrush>-->
|
||||
<LinearGradientBrush x:Key="LighterBaseGradientBrush" StartPoint="0,1" EndPoint="0,0">
|
||||
<LinearGradientBrush.GradientStops>
|
||||
<GradientStop Color="{DynamicResource Base2Color}" Offset="0" />
|
||||
<GradientStop Color="{DynamicResource Base1Color}" Offset="0.1" />
|
||||
<GradientStop Color="{DynamicResource Base1Color}" Offset="0.5" />
|
||||
<GradientStop Color="{DynamicResource Base1Color}" Offset="1" />
|
||||
</LinearGradientBrush.GradientStops>
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="ProgressBarBrush" StartPoint="0,1" EndPoint="0,0">
|
||||
<LinearGradientBrush.GradientStops>
|
||||
<GradientStop Color="{DynamicResource Base2Color}" Offset="0" />
|
||||
<GradientStop Color="Transparent" Offset="0.2" />
|
||||
<GradientStop Color="Transparent" Offset="0.8" />
|
||||
<GradientStop Color="{DynamicResource Base2Color}" Offset="1" />
|
||||
</LinearGradientBrush.GradientStops>
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="ProgressBarGlowBrush" StartPoint="1,0" EndPoint="0,0">
|
||||
<LinearGradientBrush.GradientStops>
|
||||
<GradientStop Color="Transparent" Offset="0" />
|
||||
<GradientStop Color="Transparent" Offset="0.4" />
|
||||
<GradientStop Color="{DynamicResource SelectedColor}" Offset="0.5" />
|
||||
<GradientStop Color="Transparent" Offset="0.7" />
|
||||
<GradientStop Color="Transparent" Offset="1" />
|
||||
</LinearGradientBrush.GradientStops>
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="LighterBaseGradientHoverBrush"
|
||||
StartPoint="0,0"
|
||||
EndPoint="0,1">
|
||||
<LinearGradientBrush.GradientStops>
|
||||
<GradientStop Color="#50444444" Offset="0" />
|
||||
<GradientStop Color="#50333333" Offset="1" />
|
||||
</LinearGradientBrush.GradientStops>
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush x:Key="LighterBaseGradientBrush2"
|
||||
StartPoint="0,0"
|
||||
EndPoint="0,1">
|
||||
<GradientStop Color="{DynamicResource Base2Color}" Offset="0" />
|
||||
<GradientStop Color="{DynamicResource Base1Color}" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<SolidColorBrush Color="{DynamicResource SelectedColor}" x:Key="SelectedBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource DarkerSelectedColor}" x:Key="DarkerSelectedBrush" />
|
||||
<SolidColorBrush x:Key="SelectedTabColorBrush" Color="{DynamicResource Base5Color}" />
|
||||
<SolidColorBrush x:Key="HoverTabColorBrush" Color="{DynamicResource Base6Color}" />
|
||||
<SolidColorBrush Color="Transparent" x:Key="TransparentBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource TextColor}" x:Key="GlyphBrush" />
|
||||
|
||||
<LinearGradientBrush x:Key="DisabledBrush" EndPoint="0,0" StartPoint="6,6" MappingMode="Absolute" SpreadMethod="Repeat">
|
||||
<GradientStop Color="{DynamicResource Base2Color}" Offset="0" />
|
||||
<GradientStop Color="{DynamicResource Base2Color}" Offset="0.5" />
|
||||
<GradientStop Color="{DynamicResource Base3Color}" Offset="0.5" />
|
||||
<GradientStop Color="{DynamicResource Base3Color}" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<!-- <SolidColorBrush x:Key="DisabledBrush" Color="{StaticResource Base3Color}" />-->
|
||||
<!-- <SolidColorBrush x:Key="DisabledBorderBrush" Color="{StaticResource Base3Color}" />-->
|
||||
<LinearGradientBrush x:Key="DisabledBorderBrush" EndPoint="0,0" StartPoint="6,6" MappingMode="Absolute" SpreadMethod="Repeat">
|
||||
<GradientStop Color="{DynamicResource Base2Color}" Offset="0" />
|
||||
<GradientStop Color="{DynamicResource Base2Color}" Offset="0.5" />
|
||||
<GradientStop Color="{DynamicResource Base3Color}" Offset="0.5" />
|
||||
<GradientStop Color="{DynamicResource Base3Color}" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<SolidColorBrush x:Key="SelectedTabItemHeaderBrush" Color="{DynamicResource BaseColor}" />
|
||||
<!--<SolidColorBrush x:Key="TabItemHeaderBrush" Color="{DynamicResource Base1Color}" />-->
|
||||
|
||||
<Geometry x:Key="Checkmark">M 0,5.1 L 1.7,5.2 L 3.4,7.1 L 8,0.4 L 9.2,0 L 3.3,10.8 Z</Geometry>
|
||||
<Geometry x:Key="UpArrow">M 0,4 L 3.5,0 L 7,4 Z</Geometry>
|
||||
<Geometry x:Key="DownArrow">M 0,0 L 3.5,4 L 7,0 Z</Geometry>
|
||||
<Geometry x:Key="RightArrow">M 0,0 L 4,3.5 L 0,7 Z</Geometry>
|
||||
<MenuScrollingVisibilityConverter x:Key="MenuScrollingVisibilityConverter"/>
|
||||
<SolidColorBrush x:Key="MenuHoverBrush" Color="{DynamicResource Base3TColor}" />
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0" x:Key="ProgressbarAnimationBrush">
|
||||
<GradientStop Color="Transparent" Offset="0" />
|
||||
<GradientStop Color="#88FFFFFF" Offset="0.5" />
|
||||
<GradientStop Color="Transparent" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<BorderGapMaskConverter x:Key="BorderGapMaskConverter"/>
|
||||
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1" x:Key="ProgressBarIndicatorBackground">
|
||||
<GradientStop Color="{DynamicResource Base3Color}" Offset="0" />
|
||||
<GradientStop Color="{DynamicResource Base1Color}" Offset="0.5" />
|
||||
<GradientStop Color="{DynamicResource Base3Color}" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0" x:Key="ProgressBarAnimationBackground">
|
||||
<GradientStop Color="Transparent" Offset="0" />
|
||||
<GradientStop Color="{DynamicResource Base1Color}" Offset="0.8" />
|
||||
<GradientStop Color="Transparent" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<Geometry x:Key="SliderThumbDisabledGeometry">M -5,-10.5 L 5,-10.5 L 5,10.5 L -5,10.5 Z</Geometry>
|
||||
<Geometry x:Key="SliderPointedThumbDisabledGeometry">M 4.5,-8.5 L -4.5,-8.5 L -4.5,4.5 L -0.5,8.5 L 0.5,8.5 L 4.5,4.5 Z</Geometry>
|
||||
<Geometry x:Key="SliderPointedThumbOuterBorderGeometry">M 4.5,-7.5 A 1 1 0 0 0 3.5,-8.5 L -3.5,-8.5 A 1 1 0 0 0 -4.5,-7.5 L -4.5,4.5 L -0.5,8.5 L 0.5,8.5 L 4.5,4.5 Z</Geometry>
|
||||
<Geometry x:Key="SliderPointedThumbMiddleBorderGeometry">M 3.5,-7.5 L -3.5,-7.5 L -3.5,4.5 L 0,8 L 3.5,4.5 Z</Geometry>
|
||||
<LinearGradientBrush x:Key="HorizontalSliderThumbNormalBackground" EndPoint="0,1" StartPoint="0,0">
|
||||
<GradientStop Color="{DynamicResource Base3Color}" Offset="0"/>
|
||||
<GradientStop Color="{DynamicResource Base1Color}" Offset=".8"/>
|
||||
</LinearGradientBrush>
|
||||
<Geometry x:Key="SliderThumbOuterBorderGeometry">M -5,-9.5 L 5,-9.5 L 5,9.5 L -5,9.5 Z</Geometry>
|
||||
<Geometry x:Key="SliderThumbMiddleBorderGeometry">M -4,-8.5 L 4,-8.5 L 4,8.5 L -4,8.5 Z</Geometry>
|
||||
<LinearGradientBrush x:Key="VerticalSliderThumbNormalBackground" EndPoint="1,0" StartPoint="0,0">
|
||||
<GradientStop Color="{DynamicResource Base3Color}" Offset="0"/>
|
||||
<GradientStop Color="{DynamicResource Base1Color}" Offset=".8"/>
|
||||
</LinearGradientBrush>
|
||||
|
||||
<SolidColorBrush x:Key="WindowTitleColorBrush" Color="{DynamicResource DarkerSelectedColor}" />
|
||||
</ResourceDictionary>
|
|
@ -0,0 +1,22 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:ProgramQueuer">
|
||||
<Color x:Key="BaseColor">#1f1f1f</Color>
|
||||
<Color x:Key="Base1Color">#353535</Color>
|
||||
<Color x:Key="Base2Color">#333</Color>
|
||||
<Color x:Key="Base3Color">#606060</Color>
|
||||
<Color x:Key="Base3TColor">#3300FFFF</Color>
|
||||
<Color x:Key="SelectedColorLight">#0b6767</Color>
|
||||
<Color x:Key="Base5Color">#999</Color>
|
||||
<Color x:Key="Base4Color">#555</Color>
|
||||
<Color x:Key="Base6Color">#BBB</Color>
|
||||
<Color x:Key="BaseM1Color">#222</Color>
|
||||
<Color x:Key="BaseM2Color">#1f1f1f</Color>
|
||||
<Color x:Key="BaseM2TColor">#1f1f1f</Color>
|
||||
<Color x:Key="TextColor">#ffffff</Color>
|
||||
<Color x:Key="SelectedColor">Cyan</Color>
|
||||
<Color x:Key="DarkerSelectedColor">DarkCyan</Color>
|
||||
<Color x:Key="DarkerSelectedColorHover">#33008B8B</Color>
|
||||
<Color x:Key="ErrorColor">#ff8888</Color>
|
||||
<Color x:Key="DarkErrorColor">#aa4444</Color>
|
||||
</ResourceDictionary>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
|
@ -10,10 +10,27 @@
|
|||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ProgramQueuer</RootNamespace>
|
||||
<AssemblyName>ProgramQueuer</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
|
@ -24,6 +41,7 @@
|
|||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
|
@ -33,13 +51,19 @@
|
|||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>reports.ico</ApplicationIcon>
|
||||
<ApplicationIcon>logo.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="PresentationFramework.Aero" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
|
@ -63,9 +87,6 @@
|
|||
<Compile Include="Queuer\EntryManager.cs" />
|
||||
<Compile Include="Queuer\ProcessIOManager.cs" />
|
||||
<Compile Include="Queuer\ProgramEntry.cs" />
|
||||
<Compile Include="Settings.xaml.cs">
|
||||
<DependentUpon>Settings.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
@ -78,7 +99,15 @@
|
|||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Page Include="Settings.xaml">
|
||||
<Page Include="Monotone.Brushes.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Monotone.Colors.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Monotone.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
|
@ -107,30 +136,26 @@
|
|||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
<Resource Include="Resources\fixedsys.ttf" />
|
||||
<Resource Include="Resources\fontawesome-solid.otf" />
|
||||
<Resource Include="Resources\fontawesome.otf" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\accept.png" />
|
||||
<Resource Include="Resources\remove.png" />
|
||||
<Resource Include="Resources\window.png" />
|
||||
<Resource Include="logo.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\application.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\stop.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\warning.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\play.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="reports.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\add.png" />
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.6">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4.6 %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
|
|
@ -3,12 +3,13 @@ using System.Resources;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Markup;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("ProgramQueuer")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyDescription("Provides easy interface to queue programs or batch.")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft")]
|
||||
[assembly: AssemblyProduct("ProgramQueuer")]
|
||||
|
@ -51,5 +52,5 @@ using System.Windows;
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: AssemblyVersion("1.2.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.2.0.0")]
|
||||
|
|
|
@ -1,71 +1,73 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.1
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ProgramQueuer.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProgramQueuer.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace ProgramQueuer.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProgramQueuer.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||
/// </summary>
|
||||
internal static System.Drawing.Icon program {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("program", resourceCulture);
|
||||
return ((System.Drawing.Icon)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
|
@ -60,6 +60,7 @@
|
|||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
|
@ -68,9 +69,10 @@
|
|||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
|
@ -85,9 +87,10 @@
|
|||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
|
@ -109,9 +112,13 @@
|
|||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="program" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\logo.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
|
@ -1,7 +1,7 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.1
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
|
@ -12,7 +12,7 @@ namespace ProgramQueuer.Properties {
|
|||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
@ -73,7 +73,7 @@ namespace ProgramQueuer.Properties {
|
|||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("50")]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("100")]
|
||||
public double columnWidth2 {
|
||||
get {
|
||||
return ((double)(this["columnWidth2"]));
|
||||
|
@ -94,5 +94,53 @@ namespace ProgramQueuer.Properties {
|
|||
this["columnWidth3"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||
public bool redirectOutput {
|
||||
get {
|
||||
return ((bool)(this["redirectOutput"]));
|
||||
}
|
||||
set {
|
||||
this["redirectOutput"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||
public bool rememberLast {
|
||||
get {
|
||||
return ((bool)(this["rememberLast"]));
|
||||
}
|
||||
set {
|
||||
this["rememberLast"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string lastPath {
|
||||
get {
|
||||
return ((string)(this["lastPath"]));
|
||||
}
|
||||
set {
|
||||
this["lastPath"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string lastjobs {
|
||||
get {
|
||||
return ((string)(this["lastjobs"]));
|
||||
}
|
||||
set {
|
||||
this["lastjobs"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,10 +15,22 @@
|
|||
<Value Profile="(Default)">300</Value>
|
||||
</Setting>
|
||||
<Setting Name="columnWidth2" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">50</Value>
|
||||
<Value Profile="(Default)">100</Value>
|
||||
</Setting>
|
||||
<Setting Name="columnWidth3" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">200</Value>
|
||||
</Setting>
|
||||
<Setting Name="redirectOutput" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="rememberLast" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="lastPath" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="lastjobs" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)"></Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
|
@ -6,38 +6,83 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Management;
|
||||
|
||||
namespace ProgramQueuer.Queuer
|
||||
namespace ProgramQueuer.Queuer
|
||||
{
|
||||
public class EntryManager : INotifyPropertyChanged
|
||||
{
|
||||
bool _working;
|
||||
bool _clearNext;
|
||||
string _buffer;
|
||||
bool _redirectOutput;
|
||||
bool _changed;
|
||||
ProgramEntry _currentEntry;
|
||||
Process _currentProcess;
|
||||
ProcessIOManager _processManager;
|
||||
|
||||
public EntryManager()
|
||||
{
|
||||
QueueList = new ObservableCollection<ProgramEntry>();
|
||||
_buffer = "";
|
||||
_changed = false;
|
||||
_currentEntry = null;
|
||||
_processManager = new ProcessIOManager();
|
||||
_processManager.StderrTextRead += new StringReadEventHandler(_processManager_StdoutTextRead);
|
||||
_processManager.StdoutTextRead += new StringReadEventHandler(_processManager_StdoutTextRead);
|
||||
_currentProcess = new Process();
|
||||
_currentProcess.StartInfo.UseShellExecute = false;
|
||||
_currentProcess.StartInfo.RedirectStandardOutput = true;
|
||||
_currentProcess.StartInfo.RedirectStandardError = true;
|
||||
_currentProcess.StartInfo.RedirectStandardInput = true;
|
||||
_currentProcess.StartInfo.CreateNoWindow = true;
|
||||
_currentProcess.EnableRaisingEvents = true;
|
||||
_currentProcess.Exited += new EventHandler(_currentProcess_Exited);
|
||||
_redirectOutput = true;
|
||||
}
|
||||
|
||||
public void Load()
|
||||
{
|
||||
var oldQueue = ProgramQueuer.Properties.Settings.Default.lastjobs;
|
||||
if (oldQueue.Length == 0) return;
|
||||
|
||||
var items = oldQueue.Split(';');
|
||||
for (int i = 0; i < items.Length; i++)
|
||||
{
|
||||
var values = items[i].Split('|');
|
||||
var base64EncodedBytes = System.Convert.FromBase64String(values[2]);
|
||||
var entry = new ProgramEntry {
|
||||
Name = values[0],
|
||||
Finished = values[1] == "true",
|
||||
Status = values[1] == "true" ? "Finished" : "Queued",
|
||||
Output = System.Text.Encoding.UTF8.GetString(base64EncodedBytes)
|
||||
};
|
||||
entry.Parent = this;
|
||||
this.QueueList.Add(entry);
|
||||
}
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder("");
|
||||
for (int i = 0; i < this.QueueList.Count; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
sb.Append(';');
|
||||
}
|
||||
var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(this.QueueList[i].Output != null ? this.QueueList[i].Output : "");
|
||||
sb.Append(String.Format("{0}|{1}|{2}", this.QueueList[i].Name, this.QueueList[i].Finished ? "true" : "false", System.Convert.ToBase64String(plainTextBytes)));
|
||||
}
|
||||
ProgramQueuer.Properties.Settings.Default.lastjobs = sb.ToString();
|
||||
ProgramQueuer.Properties.Settings.Default.Save();
|
||||
_changed = false;
|
||||
}
|
||||
|
||||
public void TriggerSave()
|
||||
{
|
||||
if (_changed) return;
|
||||
|
||||
_changed = true;
|
||||
|
||||
var task = new Task(async () =>
|
||||
{
|
||||
await Task.Delay(60000);
|
||||
if (!_changed == false) return;
|
||||
_changed = false;
|
||||
this.Save();
|
||||
});
|
||||
task.Start();
|
||||
}
|
||||
|
||||
public ObservableCollection<ProgramEntry> QueueList;
|
||||
public event PropertyChangedEventHandler PropertyChanged = delegate { };
|
||||
public event EventHandler OnEntryFinish = delegate { };
|
||||
|
||||
public ProgramEntry CurrentEntry
|
||||
{
|
||||
|
@ -59,117 +104,147 @@ namespace ProgramQueuer.Queuer
|
|||
}
|
||||
}
|
||||
|
||||
public void RunQueuer()
|
||||
public bool RedirectOutput
|
||||
{
|
||||
if (QueueList.Count > 0)
|
||||
get { return _redirectOutput; }
|
||||
set
|
||||
{
|
||||
Working = true;
|
||||
RunProgram(QueueList[0]);
|
||||
_redirectOutput = value;
|
||||
PropertyChanged(this, new PropertyChangedEventArgs("RedirectOutput"));
|
||||
}
|
||||
}
|
||||
|
||||
public void ForceStopCurrent()
|
||||
public void RunQueuer()
|
||||
{
|
||||
_currentProcess.Kill();
|
||||
var finished = RunNext();
|
||||
Working = !finished;
|
||||
}
|
||||
|
||||
public void ForceStop()
|
||||
{
|
||||
this.Working = false;
|
||||
_currentProcess.Kill();
|
||||
foreach (var entry in QueueList)
|
||||
if (entry.Working)
|
||||
{
|
||||
ForceStopEntry(entry);
|
||||
}
|
||||
this.Save();
|
||||
}
|
||||
|
||||
private void RunProgram(ProgramEntry entry)
|
||||
public void ForceStopEntry(ProgramEntry entry)
|
||||
{
|
||||
KillProcessAndChildren(entry.Process.Id);
|
||||
entry.Output += "\n\n[Process was forcefully stopped]";
|
||||
// entry.Process.CloseMainWindow();
|
||||
// entry.Process.Kill();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Kill a process, and all of its children, grandchildren, etc.
|
||||
/// </summary>
|
||||
/// <param name="pid">Process ID.</param>
|
||||
private static void KillProcessAndChildren(int pid)
|
||||
{
|
||||
// Cannot close 'system idle process'.
|
||||
if (pid == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ManagementObjectSearcher searcher = new ManagementObjectSearcher
|
||||
("Select * From Win32_Process Where ParentProcessID=" + pid);
|
||||
ManagementObjectCollection moc = searcher.Get();
|
||||
foreach (ManagementObject mo in moc)
|
||||
{
|
||||
KillProcessAndChildren(Convert.ToInt32(mo["ProcessID"]));
|
||||
}
|
||||
try
|
||||
{
|
||||
Process proc = Process.GetProcessById(pid);
|
||||
proc.Kill();
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
// Process already exited.
|
||||
}
|
||||
}
|
||||
|
||||
public ProgramEntry AddToQueue(ProgramEntry entry)
|
||||
{
|
||||
entry.Parent = this;
|
||||
this.QueueList.Add(entry);
|
||||
this.Save();
|
||||
return entry;
|
||||
}
|
||||
|
||||
public void RunProgram(ProgramEntry entry)
|
||||
{
|
||||
try
|
||||
{
|
||||
_currentEntry = entry;
|
||||
_currentEntry.Output = "";
|
||||
_currentEntry.Working = true;
|
||||
_currentEntry.Status = "Starting";
|
||||
_currentProcess.StartInfo.FileName = _currentEntry.Name;
|
||||
_currentProcess.StartInfo.WorkingDirectory = new FileInfo(_currentEntry.Name).DirectoryName;
|
||||
_currentProcess.Start();
|
||||
_processManager.RunningProcess = _currentProcess;
|
||||
_processManager.StartProcessOutputRead();
|
||||
entry.Output = "";
|
||||
entry.Working = true;
|
||||
entry.Process.Exited += _currentProcess_Exited;
|
||||
entry.StartProcess(_redirectOutput);
|
||||
entry.Status = "Running";
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_currentEntry.Working = false;
|
||||
_currentEntry.Finished = false;
|
||||
_currentEntry.Output += string.Format("Error while starting {0}:\n\n{1}", _currentEntry.Name, e.ToString());
|
||||
entry.Working = false;
|
||||
entry.Finished = false;
|
||||
entry.Status = string.Format("Error while starting: {0}", e.Message);
|
||||
entry.Output += string.Format("Error while starting {0}:\n\n{1}", entry.Name, e.ToString());
|
||||
if (RunNext())
|
||||
{
|
||||
_currentEntry = null;
|
||||
this.Working = false;
|
||||
}
|
||||
this.Save();
|
||||
}
|
||||
}
|
||||
|
||||
private bool RunNext()
|
||||
{
|
||||
_currentEntry.Status = "Finished";
|
||||
if (QueueList.IndexOf(_currentEntry) >= 0 && QueueList.IndexOf(_currentEntry) < QueueList.Count - 1)
|
||||
RunProgram(QueueList[QueueList.IndexOf(_currentEntry) + 1]);
|
||||
else
|
||||
return true;
|
||||
return false;
|
||||
for (int i = 0; i < QueueList.Count; i++)
|
||||
{
|
||||
if (!QueueList[i].Finished && !QueueList[i].Working)
|
||||
{
|
||||
_currentEntry = QueueList[i];
|
||||
RunProgram(_currentEntry);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void _currentProcess_Exited(object sender, EventArgs e)
|
||||
{
|
||||
_processManager.StopMonitoringProcessOutput();
|
||||
_currentEntry.Working = false;
|
||||
_currentEntry.Finished = true;
|
||||
if (!this.Working)
|
||||
return;
|
||||
if (RunNext())
|
||||
string path = (sender as Process).StartInfo.FileName;
|
||||
ProgramEntry curr = null;
|
||||
foreach (var entry in QueueList)
|
||||
{
|
||||
_currentEntry = null;
|
||||
this.Working = false;
|
||||
if (entry.Process == sender as Process)
|
||||
{
|
||||
curr = entry;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (curr.Redirected)
|
||||
curr.ProcessManager.StopMonitoringProcessOutput();
|
||||
curr.Working = false;
|
||||
curr.Finished = true;
|
||||
curr.Status = "Finished";
|
||||
|
||||
void _processManager_StdoutTextRead(string text)
|
||||
{
|
||||
string[] lines = text.Split('\r');
|
||||
if (!text.EndsWith("\r") && !text.EndsWith("\n") && _clearNext)
|
||||
{
|
||||
_buffer += text;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
text = _buffer + text;
|
||||
_buffer = "";
|
||||
}
|
||||
this.Save();
|
||||
|
||||
OnEntryFinish(curr, new EventArgs());
|
||||
|
||||
|
||||
if (_clearNext && text == "\n")
|
||||
_clearNext = false;
|
||||
|
||||
while (text.IndexOf('\b') >= 0)
|
||||
{
|
||||
if (_currentEntry.Output.Length > 0 && _currentEntry.Output[_currentEntry.Output.Length - 1] != '\n')
|
||||
_currentEntry.Output = _currentEntry.Output.Remove(_currentEntry.Output.Length - 1);
|
||||
text = text.Remove(text.IndexOf('\b'), 1);
|
||||
}
|
||||
|
||||
if (_clearNext && text.Replace("\n", "").Replace("\r", "").Trim() != "")
|
||||
if (_currentEntry.Output.LastIndexOf('\n') < _currentEntry.Output.Length - 1)
|
||||
_currentEntry.Output = _currentEntry.Output.Remove(_currentEntry.Output.LastIndexOf('\n') + 1) + text;
|
||||
else
|
||||
_currentEntry.Output += text;
|
||||
else
|
||||
_currentEntry.Output += text;
|
||||
|
||||
if (text.Replace("\n", "").Trim() != "")
|
||||
_currentEntry.Status = text.Replace("\n", "").Replace("\r", "");
|
||||
|
||||
if (lines.Length == 2 && lines[1] == "")
|
||||
_clearNext = true;
|
||||
else
|
||||
_clearNext = false;
|
||||
if (curr == _currentEntry)
|
||||
if (!this.Working)
|
||||
return;
|
||||
else if (RunNext())
|
||||
{
|
||||
_currentEntry = null;
|
||||
this.Working = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -248,7 +248,7 @@ namespace ProgramQueuer.Queuer
|
|||
StderrTextRead(textbuffer.ToString());
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
// 'Clear' the text buffer
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace ProgramQueuer.Queuer
|
||||
{
|
||||
|
@ -11,17 +13,38 @@ namespace ProgramQueuer.Queuer
|
|||
bool _error;
|
||||
bool _working;
|
||||
bool _finished;
|
||||
bool _clearNext;
|
||||
bool _redirected;
|
||||
string _name;
|
||||
string _output;
|
||||
string _status;
|
||||
string _buffer;
|
||||
Process _process;
|
||||
ProcessIOManager _processManager;
|
||||
|
||||
public ProgramEntry()
|
||||
{
|
||||
Finished = false;
|
||||
|
||||
this.Parent = null;
|
||||
_process = new Process();
|
||||
_process.StartInfo.UseShellExecute = false;
|
||||
_process.EnableRaisingEvents = true;
|
||||
|
||||
_processManager = new ProcessIOManager();
|
||||
_processManager.StderrTextRead += new StringReadEventHandler(_processManager_StdoutTextRead);
|
||||
_processManager.StdoutTextRead += new StringReadEventHandler(_processManager_StdoutTextRead);
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged = delegate { };
|
||||
|
||||
public EntryManager Parent;
|
||||
|
||||
public bool Redirected
|
||||
{
|
||||
get => _redirected;
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return _name; }
|
||||
|
@ -62,6 +85,17 @@ namespace ProgramQueuer.Queuer
|
|||
}
|
||||
}
|
||||
|
||||
public Process Process
|
||||
{
|
||||
get { return _process; }
|
||||
set { _process = value; }
|
||||
}
|
||||
|
||||
public ProcessIOManager ProcessManager
|
||||
{
|
||||
get { return _processManager; }
|
||||
set { _processManager = value; }
|
||||
}
|
||||
public bool Working
|
||||
{
|
||||
get { return _working; }
|
||||
|
@ -81,5 +115,73 @@ namespace ProgramQueuer.Queuer
|
|||
PropertyChanged(this, new PropertyChangedEventArgs("Error"));
|
||||
}
|
||||
}
|
||||
|
||||
public void StartProcess(bool redirect)
|
||||
{
|
||||
_process.StartInfo.RedirectStandardOutput = redirect;
|
||||
_process.StartInfo.RedirectStandardError = redirect;
|
||||
_process.StartInfo.RedirectStandardInput = redirect;
|
||||
_process.StartInfo.CreateNoWindow = redirect;
|
||||
_process.StartInfo.FileName = this.Name;
|
||||
_process.StartInfo.WorkingDirectory = new FileInfo(this.Name).DirectoryName;
|
||||
_process.Start();
|
||||
if (redirect)
|
||||
{
|
||||
_redirected = true;
|
||||
_processManager.RunningProcess = _process;
|
||||
_processManager.StartProcessOutputRead();
|
||||
}
|
||||
}
|
||||
|
||||
void _processManager_StdoutTextRead(string text)
|
||||
{
|
||||
string[] lines = text.Split('\r');
|
||||
if (!text.EndsWith("\r") && !text.EndsWith("\n") && _clearNext)
|
||||
{
|
||||
_buffer += text;
|
||||
if (this.Parent != null)
|
||||
{
|
||||
this.Parent.TriggerSave();
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
text = _buffer + text;
|
||||
_buffer = "";
|
||||
}
|
||||
|
||||
|
||||
if (_clearNext && text == "\n")
|
||||
_clearNext = false;
|
||||
|
||||
while (text.IndexOf('\b') >= 0)
|
||||
{
|
||||
if (this.Output.Length > 0 && this.Output[this.Output.Length - 1] != '\n')
|
||||
this.Output = this.Output.Remove(this.Output.Length - 1);
|
||||
text = text.Remove(text.IndexOf('\b'), 1);
|
||||
}
|
||||
|
||||
if (_clearNext && text.Replace("\n", "").Replace("\r", "").Trim() != "")
|
||||
if (this.Output.LastIndexOf('\n') < this.Output.Length - 1)
|
||||
this.Output = this.Output.Remove(this.Output.LastIndexOf('\n') + 1) + text;
|
||||
else
|
||||
this.Output += text;
|
||||
else
|
||||
this.Output += text;
|
||||
|
||||
if (text.Replace("\n", "").Trim() != "")
|
||||
this.Status = text.Replace("\n", "").Replace("\r", "");
|
||||
|
||||
if (lines.Length == 2 && lines[1] == "")
|
||||
_clearNext = true;
|
||||
else
|
||||
_clearNext = false;
|
||||
|
||||
if (this.Parent != null)
|
||||
{
|
||||
this.Parent.TriggerSave();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Before Width: | Height: | Size: 984 B |
Before Width: | Height: | Size: 940 B |
Before Width: | Height: | Size: 554 B |
Before Width: | Height: | Size: 923 B |
Before Width: | Height: | Size: 1004 B |
Before Width: | Height: | Size: 913 B |
Before Width: | Height: | Size: 713 B |
Before Width: | Height: | Size: 307 B |
|
@ -1,12 +0,0 @@
|
|||
<Window x:Class="ProgramQueuer.Settings"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="Settings" Height="300" Width="300">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
</Grid>
|
||||
</Window>
|
|
@ -1,26 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace ProgramQueuer
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for Settings.xaml
|
||||
/// </summary>
|
||||
public partial class Settings : Window
|
||||
{
|
||||
public Settings()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="ProgramQueuer.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<section name="ProgramQueuer.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<userSettings>
|
||||
|
@ -20,11 +20,17 @@
|
|||
<value>300</value>
|
||||
</setting>
|
||||
<setting name="columnWidth2" serializeAs="String">
|
||||
<value>50</value>
|
||||
<value>75</value>
|
||||
</setting>
|
||||
<setting name="columnWidth3" serializeAs="String">
|
||||
<value>200</value>
|
||||
</setting>
|
||||
<setting name="redirectOutput" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="lastPath" serializeAs="String">
|
||||
<value/>
|
||||
</setting>
|
||||
</ProgramQueuer.Properties.Settings>
|
||||
</userSettings>
|
||||
</configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup></configuration>
|
||||
|
|
After Width: | Height: | Size: 116 KiB |
Before Width: | Height: | Size: 109 KiB |
10
README.md
|
@ -1,4 +1,12 @@
|
|||
ProgramQueuer
|
||||
=============
|
||||
|
||||
Simple C# Task Queuer
|
||||
Simple C# Task Queuer and manager for those who need to run lots of encodes or bat files.
|
||||
|
||||
![Program Queuer](https://i.imgur.com/QXIVphL.png)
|
||||
|
||||
|
||||
How to use
|
||||
==========
|
||||
|
||||
Just drag whatever file you want to run onto the program and hit Start.
|
||||
|
|