private void ProcessListBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (_pidMenu)
{
_pidMenu = false;
_pid =
int.Parse(
Regex.Match(((ListImg)ProcessListBox.SelectedItem).Str, @"\s[0-9]+").Captures[0].Value
.Substring(1));
var newimg = (ImageSource)CreateBitmapSourceFromBitmap(Properties.Resources.plug);
ProcessListBox.SelectionChanged -= ProcessListBox_OnSelectionChanged;
ProcessListBox.Items.Clear();
foreach (
var file in
Directory.EnumerateFiles(Directory.GetCurrentDirectory() + "\\Plugins")
.Where(file => file.EndsWith(".dll") && !file.Contains("BolterLibrary")))
ProcessListBox.Items.Add(
new ListImg(
new string(file.Skip((Directory.GetCurrentDirectory() + "\\Plugins").Length + 1).ToArray())
.Replace(".dll", ""), newimg));
ProcessListBox.SelectionChanged += ProcessListBox_OnSelectionChanged;
DebugButton.Visibility = Visibility.Visible;
}
else
{
SelectedpluginName = ((ListImg)ProcessListBox.SelectedItem).Str;
}
}