Browse Source

Dialog for arguments and working directory was missing

pull/191/head
Ronny Klier 15 years ago
parent
commit
92e8616aab
  1. 113
      Debugger/ILSpy.Debugger/UI/ExecuteProcessWindow.xaml
  2. 89
      Debugger/ILSpy.Debugger/UI/ExecuteProcessWindow.xaml.cs

113
Debugger/ILSpy.Debugger/UI/ExecuteProcessWindow.xaml

@ -0,0 +1,113 @@ @@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<Window
x:Class="ICSharpCode.ILSpy.Debugger.UI.ExecuteProcessWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Select process to debug..."
WindowStartupLocation="CenterOwner"
WindowState="Normal"
WindowStyle="ToolWindow"
ShowInTaskbar="False"
Height="250"
Width="596">
<Grid
Height="217">
<Grid.RowDefinitions>
<RowDefinition
Height="1.4*" />
<RowDefinition
Height="0.2*" />
</Grid.RowDefinitions>
<Label
Content="Executable"
Grid.Column="0"
Grid.Row="0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Margin="19.5,28.5,0,0"
Width="92"
Height="25" />
<TextBox
Grid.Column="0"
Grid.Row="0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0,28.5,84.5,0"
Width="368"
Height="25"
Name="pathTextBox" />
<Button
Grid.Column="0"
Grid.Row="0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Margin="502.5,28.5,0,0"
Width="25"
Height="25"
Content="..."
Name="pathButton"
Click="pathButton_Click" />
<TextBox
Grid.Column="0"
Grid.Row="0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Margin="133.5,81,0,0"
Width="368"
Height="25"
Name="argumentsTextBox" />
<Label
Content="Arguments"
Grid.Column="0"
Grid.Row="0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Margin="19.5,81,0,0"
Width="92"
Height="31" />
<Button
Content="..."
Grid.Column="0"
Grid.Row="0"
HorizontalAlignment="Left"
Width="25"
Click="workingDirectoryButton_Click"
Height="25"
VerticalAlignment="Bottom"
Margin="502.5,0,0,30.875"
Name="workingDirectoryButton" />
<TextBox
Grid.Column="0"
Grid.Row="0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Margin="133.5,134,0,0"
Width="368"
Height="25"
Name="workingDirectoryTextBox" />
<Label
Content="Working directory"
Grid.Column="0"
Grid.Row="0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Margin="19.5,134,0,0"
Width="113"
Height="31" />
<DockPanel
Grid.Row="1"
LastChildFill="False">
<Button
DockPanel.Dock="Left"
HorizontalAlignment="Center"
x:Name="ExecuteButton"
Click="ExecuteButton_Click"
Content="Execute"
Width="100" />
<Button
DockPanel.Dock="Right"
x:Name="CancelButton"
Content="Cancel"
Click="CancelButton_Click"
Width="100" />
</DockPanel>
</Grid>
</Window>

89
Debugger/ILSpy.Debugger/UI/ExecuteProcessWindow.xaml.cs

@ -0,0 +1,89 @@ @@ -0,0 +1,89 @@
/*
* Created by SharpDevelop.
* User: klier
* Date: 05/13/2011
* Time: 08:44
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows;
using System.Windows.Forms;
namespace ICSharpCode.ILSpy.Debugger.UI
{
/// <summary>
/// Interaction logic for ExecuteProcessWindow.xaml
/// </summary>
public partial class ExecuteProcessWindow : Window
{
public ExecuteProcessWindow()
{
InitializeComponent();
}
public string SelectedExecutable {
get {
return pathTextBox.Text;
}
set {
pathTextBox.Text = value;
workingDirectoryTextBox.Text = Path.GetDirectoryName(value);
}
}
public string WorkingDirectory {
get {
return workingDirectoryTextBox.Text;
}
set {
workingDirectoryTextBox.Text = value;
}
}
public string Arguments {
get {
return argumentsTextBox.Text;
}
}
void pathButton_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog dialog = new OpenFileDialog() {
Filter = ".NET Executable (*.exe) | *.exe",
InitialDirectory = workingDirectoryTextBox.Text,
RestoreDirectory = true,
DefaultExt = "exe"
};
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
SelectedExecutable = dialog.FileName;
}
}
void ExecuteButton_Click(object sender, RoutedEventArgs e)
{
if (string.IsNullOrEmpty(SelectedExecutable))
return;
this.DialogResult = true;
}
void CancelButton_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
void workingDirectoryButton_Click(object sender, RoutedEventArgs e)
{
FolderBrowserDialog dialog = new FolderBrowserDialog() {
SelectedPath = workingDirectoryTextBox.Text
};
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
workingDirectoryTextBox.Text = dialog.SelectedPath;
}
}
}
}
Loading…
Cancel
Save