Add double click functionality to process selection.

This commit is contained in:
Greg
2022-12-30 01:01:34 -07:00
parent 5cdc7bc09b
commit 7273174198
5 changed files with 23 additions and 3 deletions
@@ -29,6 +29,7 @@
SelectionMode="Single"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Visible"
MouseDoubleClick="ProcessList_MouseDoubleClick"
AlternationCount="2" Grid.ColumnSpan="2">
<ListView.View>
@@ -1,6 +1,7 @@
using OrbisLib2.Targets;
using SimpleUI.Dialogs;
using System.Windows;
using System.Windows.Controls.Primitives;
namespace OrbisLib2.Dialog
{
@@ -22,6 +23,14 @@ namespace OrbisLib2.Dialog
{
var dlg = new SelectProcess(Owner);
dlg.ShowDialog();
var selectedProc = (ProcInfo)dlg.ProcessList.SelectedItem;
if(selectedProc != null)
{
// TODO: Handle Attach here.
Console.WriteLine($"Attaching to {selectedProc.Name}");
}
return dlg.Result;
}
@@ -53,5 +62,15 @@ namespace OrbisLib2.Dialog
{
RefreshProcessList();
}
private void ProcessList_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
var item = ((FrameworkElement)e.OriginalSource).DataContext as ProcInfo;
if (item != null && ProcessList.SelectedItem != null)
{
Result = SimpleDialogResult.Button1;
Close();
}
}
}
}
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
@@ -1 +1 @@
2176
2183
@@ -1 +1 @@
Version 3.0.2176 Debug Build Friday December 30 2022 12:43 AM
Version 3.0.2183 Debug Build Friday December 30 2022 12:59 AM