Add prototype GUI
This commit is contained in:
9
ExeLauncher.GUI/App.xaml
Normal file
9
ExeLauncher.GUI/App.xaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<Application x:Class="ExeLauncher.GUI.App"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:local="clr-namespace:ExeLauncher.GUI"
|
||||||
|
StartupUri="MainWindow.xaml">
|
||||||
|
<Application.Resources>
|
||||||
|
|
||||||
|
</Application.Resources>
|
||||||
|
</Application>
|
||||||
17
ExeLauncher.GUI/App.xaml.cs
Normal file
17
ExeLauncher.GUI/App.xaml.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace ExeLauncher.GUI
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for App.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class App : Application
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
35
ExeLauncher.GUI/AppControl.xaml
Normal file
35
ExeLauncher.GUI/AppControl.xaml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<UserControl x:Class="ExeLauncher.GUI.AppControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="clr-namespace:ExeLauncher.GUI"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
||||||
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="35" />
|
||||||
|
<RowDefinition Height="35" />
|
||||||
|
<RowDefinition Height="35" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<!--Path-->
|
||||||
|
<TextBlock Grid.Column="0" Grid.Row="0" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5" Text="Path:" />
|
||||||
|
<TextBox Grid.Column="1" Grid.Row="0" Margin="5" VerticalContentAlignment="Center" Text="{Binding ApplicationPath}" />
|
||||||
|
<Button Grid.Column="2" Grid.Row="0" Margin="5" Padding="5,2" Content="Browse" Click="Button_Path" />
|
||||||
|
|
||||||
|
<!--Arguments-->
|
||||||
|
<TextBlock Grid.Column="0" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5" Text="Arugments:" />
|
||||||
|
<TextBox Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" Margin="5" VerticalContentAlignment="Center" Text="{Binding ApplicationArguments}" />
|
||||||
|
|
||||||
|
<!--Working Directory-->
|
||||||
|
<TextBlock Grid.Column="0" Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5" Text="Working Directory:" />
|
||||||
|
<TextBox Grid.Column="1" Grid.Row="2" Margin="5" VerticalContentAlignment="Center" Text="{Binding ApplicationWorkingDirectory}" />
|
||||||
|
<Button Grid.Column="2" Grid.Row="2" Margin="5" Padding="5,2" Content="Browse" Click="Button_WorkingDirectory" />
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
70
ExeLauncher.GUI/AppControl.xaml.cs
Normal file
70
ExeLauncher.GUI/AppControl.xaml.cs
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
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.Navigation;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace ExeLauncher.GUI
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Logique d'interaction pour AppControl.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class AppControl : UserControl
|
||||||
|
{
|
||||||
|
public string ApplicationPath
|
||||||
|
{
|
||||||
|
get { return (string)GetValue(ApplicationPathProperty); }
|
||||||
|
set { SetValue(ApplicationPathProperty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Using a DependencyProperty as the backing store for ApplicationPath. This enables animation, styling, binding, etc...
|
||||||
|
public static readonly DependencyProperty ApplicationPathProperty =
|
||||||
|
DependencyProperty.Register("ApplicationPath", typeof(string), typeof(AppControl), new PropertyMetadata(""));
|
||||||
|
|
||||||
|
public string ApplicationArguments
|
||||||
|
{
|
||||||
|
get { return (string)GetValue(ApplicationArgumentsProperty); }
|
||||||
|
set { SetValue(ApplicationArgumentsProperty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Using a DependencyProperty as the backing store for ApplicationArguments. This enables animation, styling, binding, etc...
|
||||||
|
public static readonly DependencyProperty ApplicationArgumentsProperty =
|
||||||
|
DependencyProperty.Register("ApplicationArguments", typeof(string), typeof(AppControl), new PropertyMetadata(""));
|
||||||
|
|
||||||
|
public string ApplicationWorkingDirectory
|
||||||
|
{
|
||||||
|
get { return (string)GetValue(ApplicationWorkingDirectoryProperty); }
|
||||||
|
set { SetValue(ApplicationWorkingDirectoryProperty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Using a DependencyProperty as the backing store for ApplicationWorkingDirectory. This enables animation, styling, binding, etc...
|
||||||
|
public static readonly DependencyProperty ApplicationWorkingDirectoryProperty =
|
||||||
|
DependencyProperty.Register("ApplicationWorkingDirectory", typeof(string), typeof(AppControl), new PropertyMetadata(""));
|
||||||
|
|
||||||
|
public AppControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
//DataContext = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_Path(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_WorkingDirectory(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
16
ExeLauncher.GUI/ApplicationModel.cs
Normal file
16
ExeLauncher.GUI/ApplicationModel.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ExeLauncher.GUI
|
||||||
|
{
|
||||||
|
internal record ApplicationModel
|
||||||
|
{
|
||||||
|
public int Number { get; set; } = 1;
|
||||||
|
public string Path { get; set; } = "";
|
||||||
|
public string Arguments { get; set; } = "";
|
||||||
|
public string WorkingDirectory { get; set; } = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
10
ExeLauncher.GUI/AssemblyInfo.cs
Normal file
10
ExeLauncher.GUI/AssemblyInfo.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
[assembly: ThemeInfo(
|
||||||
|
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||||
|
//(used if a resource is not found in the page,
|
||||||
|
// or application resource dictionaries)
|
||||||
|
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||||
|
//(used if a resource is not found in the page,
|
||||||
|
// app, or any theme specific resource dictionaries)
|
||||||
|
)]
|
||||||
14
ExeLauncher.GUI/ExeLauncher.GUI.csproj
Normal file
14
ExeLauncher.GUI/ExeLauncher.GUI.csproj
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<TargetFramework>net6.0-windows</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<UseWPF>true</UseWPF>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\ExeLauncher\ExeLauncher.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
51
ExeLauncher.GUI/MainWindow.xaml
Normal file
51
ExeLauncher.GUI/MainWindow.xaml
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<Window x:Class="ExeLauncher.GUI.MainWindow"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:ExeLauncher.GUI"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
||||||
|
Title="MainWindow" Height="450" Width="800">
|
||||||
|
<DockPanel LastChildFill="True">
|
||||||
|
<!--Controls-->
|
||||||
|
<Grid DockPanel.Dock="Bottom" Background="#F5F5F5">
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="4,0">
|
||||||
|
<Button HorizontalAlignment="Right" Margin="0,8" Padding="6,4" Content="Remove" Click="Button_Remove" />
|
||||||
|
<Button HorizontalAlignment="Right" Margin="4,8" Padding="6,4" Content="Add" Click="Button_Add" />
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
<!--Apps-->
|
||||||
|
<ScrollViewer>
|
||||||
|
<StackPanel Margin="10">
|
||||||
|
<GroupBox Header="Application Info">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="35" />
|
||||||
|
<RowDefinition Height="35" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<!--Name-->
|
||||||
|
<TextBlock Grid.Column="0" Grid.Row="0" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5" Text="Name:" />
|
||||||
|
<TextBox Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2" Margin="5" VerticalContentAlignment="Center" Text="{Binding ApplicationName}" />
|
||||||
|
|
||||||
|
<!--Icon-->
|
||||||
|
<TextBlock Grid.Column="0" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5" Text="Icon:" />
|
||||||
|
<TextBox Grid.Column="1" Grid.Row="1" Margin="5" VerticalContentAlignment="Center" Text="{Binding ApplicationIconPath}" />
|
||||||
|
<Button Grid.Column="2" Grid.Row="1" Margin="5" Padding="5,2" Content="Browse" Click="Button_Icon" />
|
||||||
|
</Grid>
|
||||||
|
</GroupBox>
|
||||||
|
<GroupBox Header="Application 1">
|
||||||
|
<local:AppControl ApplicationPath="C:\Test.exe" />
|
||||||
|
</GroupBox>
|
||||||
|
<GroupBox Header="Application 2">
|
||||||
|
<local:AppControl ApplicationPath="C:\Test.exe" />
|
||||||
|
</GroupBox>
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</DockPanel>
|
||||||
|
</Window>
|
||||||
46
ExeLauncher.GUI/MainWindow.xaml.cs
Normal file
46
ExeLauncher.GUI/MainWindow.xaml.cs
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
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.Navigation;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace ExeLauncher.GUI
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for MainWindow.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class MainWindow : Window
|
||||||
|
{
|
||||||
|
public string ApplicationName { get; set; } = "";
|
||||||
|
public string ApplicationIconPath { get; set; } = "";
|
||||||
|
|
||||||
|
public MainWindow()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_Icon(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_Add(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_Remove(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 16
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 16.0.29609.76
|
VisualStudioVersion = 17.0.31912.275
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExeLauncher", "ExeLauncher\ExeLauncher.csproj", "{E002E8E2-D13A-4995-ABAB-DF7451FDA464}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExeLauncher", "ExeLauncher\ExeLauncher.csproj", "{E002E8E2-D13A-4995-ABAB-DF7451FDA464}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExeLauncher.GUI", "ExeLauncher.GUI\ExeLauncher.GUI.csproj", "{F8F5EFC9-D012-49F5-B6B6-36CA7B33727C}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -15,6 +17,10 @@ Global
|
|||||||
{E002E8E2-D13A-4995-ABAB-DF7451FDA464}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{E002E8E2-D13A-4995-ABAB-DF7451FDA464}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{E002E8E2-D13A-4995-ABAB-DF7451FDA464}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{E002E8E2-D13A-4995-ABAB-DF7451FDA464}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{E002E8E2-D13A-4995-ABAB-DF7451FDA464}.Release|Any CPU.Build.0 = Release|Any CPU
|
{E002E8E2-D13A-4995-ABAB-DF7451FDA464}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{F8F5EFC9-D012-49F5-B6B6-36CA7B33727C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{F8F5EFC9-D012-49F5-B6B6-36CA7B33727C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{F8F5EFC9-D012-49F5-B6B6-36CA7B33727C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{F8F5EFC9-D012-49F5-B6B6-36CA7B33727C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
Reference in New Issue
Block a user