/[RomCheater]/trunk/RomCheater/Docking/FloatingPIDSelector.cs
ViewVC logotype

Diff of /trunk/RomCheater/Docking/FloatingPIDSelector.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 331 by william, Thu Jun 7 19:32:13 2012 UTC revision 332 by william, Thu Jun 7 19:56:27 2012 UTC
# Line 75  namespace RomCheater.Docking Line 75  namespace RomCheater.Docking
75              if (isAutoRefreshing && !isAttachingToProcess) return;              if (isAutoRefreshing && !isAttachingToProcess) return;
76              this.ProcessPID = Convert.ToInt32(li.SubItems[1].Text);              this.ProcessPID = Convert.ToInt32(li.SubItems[1].Text);
77              Process SelectedProcess = Process.GetProcessById(this.ProcessPID);              Process SelectedProcess = Process.GetProcessById(this.ProcessPID);
78    
79                txtstatus_Pid.Text = SelectedProcess.Id.ToString();
80                txtstatus_Filename.Text = SelectedProcess.MainModule.FileName;
81    
82              logger.Debug.WriteLine("Using Process: ({0} : {1})", SelectedProcess.Id, SelectedProcess.ProcessName);              logger.Debug.WriteLine("Using Process: ({0} : {1})", SelectedProcess.Id, SelectedProcess.ProcessName);
83              //this.Close();              //this.Close();
84              if (OnSelectedProcessChanged != null)              if (OnSelectedProcessChanged != null)
# Line 197  namespace RomCheater.Docking Line 201  namespace RomCheater.Docking
201          private void PIDSelector_Load(object sender, EventArgs e)          private void PIDSelector_Load(object sender, EventArgs e)
202          {          {
203              if (AcceptedPlugin == null || this.DesignMode) return;              if (AcceptedPlugin == null || this.DesignMode) return;
204                txtstatus_Pid.Text = "";
205                txtstatus_Filename.Text = "";
206              btnRefresh.PerformClick();              btnRefresh.PerformClick();
207          }          }
208    
# Line 229  namespace RomCheater.Docking Line 235  namespace RomCheater.Docking
235              if (isRefreshing || isAutoRefreshing) return;              if (isRefreshing || isAutoRefreshing) return;
236              //if (lstProcessList.Items.Count == 0) return;              //if (lstProcessList.Items.Count == 0) return;
237              isAutoRefreshing = true;              isAutoRefreshing = true;
238              int pid = this.ProcessPID;              int pid = this.ProcessPID;          
239              btnRefresh.PerformClick();              btnRefresh.PerformClick();
240              bool pid_still_exists = false;              bool pid_still_exists = false;
241              int item_index = -1;              int item_index = -1;
# Line 253  namespace RomCheater.Docking Line 259  namespace RomCheater.Docking
259                              lstProcessList.Items[lstProcessList.SelectedItems[0].Index].Selected = false;                              lstProcessList.Items[lstProcessList.SelectedItems[0].Index].Selected = false;
260                  }                  }
261                  lstProcessList.Items[item_index].Selected = true;                  lstProcessList.Items[item_index].Selected = true;
262                    isAutoRefreshing = false;
263              }              }
264              else              else
265              {              {
266                  if (lstProcessList.SelectedItems.Count > 0)                  if (lstProcessList.SelectedItems.Count > 0)
267                    {
268                        if (lstProcessList.SelectedItems[0] != null)
269                        {
270                            string missing_name = lstProcessList.SelectedItems[0].Text;
271                          int  missing_pid = Convert.ToInt32(lstProcessList.SelectedItems[0].SubItems[1].Text);
272                          logger.Warn.WriteLine("Connection to selected process ({0}) has been lost...Selecting the first available process.", string.Format("0x{0:x8}:{1}", missing_pid, missing_name));
273                          MessageBox.Show(string.Format("Connection to selected process ({0}) has been lost...Selecting the first available process.", string.Format("0x{0:x8}:{1}", missing_pid, missing_name)), "Connection to selected process lost", MessageBoxButtons.OK, MessageBoxIcon.Warning);
274                        }                    
275                        isAutoRefreshing = false;
276                        lstProcessList.Items[0].Selected = false;
277                      lstProcessList.Items[0].Selected = true;                      lstProcessList.Items[0].Selected = true;
278                    }
279              }              }
             isAutoRefreshing = false;  
280          }          }
281      }      }
282  }  }

Legend:
Removed from v.331  
changed lines
  Added in v.332

  ViewVC Help
Powered by ViewVC 1.1.22