-
-
Save factormystic/d6717d78efa0a226529e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
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.Shapes; | |
namespace tosproxy | |
{ | |
/// <summary> | |
/// Interaction logic for ProcessChooser.xaml | |
/// </summary> | |
public partial class ProcessChooser : Window | |
{ | |
public List<Process> ProcessList {get; private set;} | |
public ProcessChooser() | |
{ | |
GetProcessList(); | |
this.DataContext = this; | |
InitializeComponent(); | |
} | |
private void GetProcessList() | |
{ | |
ProcessList = Process.GetProcesses().ToList(); | |
Trace.WriteLine("PROCESS LIST:\n"); | |
Trace.WriteLine(ProcessList.First().Id); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window x:Class="tosproxy.ProcessChooser" | |
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" | |
mc:Ignorable="d" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:local="clr-namespace:tosproxy" | |
xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=System" | |
Title="ProcessChooser" Height="300" Width="300"> | |
<Grid> | |
<DataGrid x:Name="ProcessListView" VerticalAlignment="Top" ItemsSource="{Binding ProcessList}" | |
AutoGenerateColumns="False" CanUserResizeColumns="True"> | |
<DataGrid.Columns> | |
<DataGridTextColumn Width="40" Header="PID" Binding="{Binding Id}" /> | |
<DataGridTextColumn Width="*" Header="Name" Binding="{Binding ProcessName}" /> | |
</DataGrid.Columns> | |
</DataGrid> | |
</Grid> | |
</Window> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment