Browse Source

SharpDevelop process is not added to the list of processes in the Attach to Process dialog. This prevents SharpDevelop from attaching to itself causing it to hang.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3152 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 17 years ago
parent
commit
85d23aec85
  1. 22
      src/Main/Base/Project/Src/Gui/Dialogs/AttachToProcessForm.cs

22
src/Main/Base/Project/Src/Gui/Dialogs/AttachToProcessForm.cs

@ -30,22 +30,25 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -30,22 +30,25 @@ namespace ICSharpCode.SharpDevelop.Gui
}
public System.Diagnostics.Process Process {
get {
return GetSelectedProcess();
}
get { return GetSelectedProcess(); }
}
void RefreshProcessList()
{
listView.Items.Clear();
Process currentProcess = Process.GetCurrentProcess();
foreach (System.Diagnostics.Process process in System.Diagnostics.Process.GetProcesses()) {
try {
string fileName = Path.GetFileName(process.MainModule.FileName);
ListViewItem item = new ListViewItem(fileName);
item.SubItems.Add(process.Id.ToString());
item.SubItems.Add(process.MainWindowTitle);
item.Tag = process;
listView.Items.Add(item);
// Prevent attaching to our own process.
if (currentProcess.Id != process.Id) {
string fileName = Path.GetFileName(process.MainModule.FileName);
ListViewItem item = new ListViewItem(fileName);
item.SubItems.Add(process.Id.ToString());
item.SubItems.Add(process.MainWindowTitle);
item.Tag = process;
listView.Items.Add(item);
}
} catch (Win32Exception) {
// Do nothing.
}
@ -85,7 +88,6 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -85,7 +88,6 @@ namespace ICSharpCode.SharpDevelop.Gui
refreshButton.Text = StringParser.Parse("${res:ICSharpCode.SharpDevelop.Gui.Dialogs.AddWebReferenceDialog.RefreshButtonTooltip}");
}
void ListViewItemActivate(object sender, EventArgs e)
{
if (listView.SelectedItems.Count > 0) {

Loading…
Cancel
Save