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

Loading…
Cancel
Save