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

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

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

revision 88 by william, Wed May 9 20:52:20 2012 UTC revision 103 by william, Thu May 10 10:10:25 2012 UTC
# Line 33  namespace RomCheater Line 33  namespace RomCheater
33          public new DialogResult ShowDialog(IWin32Window owner) { return this.PreInitDialog(owner); }          public new DialogResult ShowDialog(IWin32Window owner) { return this.PreInitDialog(owner); }
34          private void PreInitShow(IWin32Window owner)          private void PreInitShow(IWin32Window owner)
35          {          {
36              if (!this.RefreshList()) { MessageBox.Show("Could not find any PCSX2 Processes.  Please start an instance of one."); }              if (!this.RefreshList()) { MessageBox.Show(string.Format("Could not find any Processes for plugin {0}.  Please start an instance of one.",plugin.ToString())); }
37              else { if (owner == null) { base.Show(); } else { base.Show(owner); } }              else { if (owner == null) { base.Show(); } else { base.Show(owner); } }
38          }          }
39          private DialogResult PreInitDialog(IWin32Window owner)          private DialogResult PreInitDialog(IWin32Window owner)
40          {          {
41              if (!this.RefreshList()) { MessageBox.Show("Could not find any PCSX2 Processes.  Please start an instance of one."); return DialogResult.Cancel; }              if (!this.RefreshList()) { MessageBox.Show(string.Format("Could not find any Processes for plugin {0}.  Please start an instance of one.", plugin.ToString())); return DialogResult.Cancel; }
42              else { if (owner == null) { return base.ShowDialog(); } else { return base.ShowDialog(owner); } }              else { if (owner == null) { return base.ShowDialog(); } else { return base.ShowDialog(owner); } }
43          }          }
44          private void btnLargeIcon_Click(object sender, EventArgs e) { this.lstProcessList.View = View.LargeIcon; }          private void btnLargeIcon_Click(object sender, EventArgs e) { this.lstProcessList.View = View.LargeIcon; }
# Line 68  namespace RomCheater Line 68  namespace RomCheater
68          private bool RefreshList()          private bool RefreshList()
69          {          {
70              lstProcessList.Items.Clear();              lstProcessList.Items.Clear();
71                this.plugin.Reload();
72              // create a selection of PCSX2 processes              // create a selection of PCSX2 processes
73              List<ProcContainer> proc_list = plugin.ValidProcessesForPlugin;              List<ProcContainer> proc_list = plugin.ValidProcessesForPlugin;
74    
# Line 90  namespace RomCheater Line 91  namespace RomCheater
91              large_image_list = new ImageList();              large_image_list = new ImageList();
92              ListViewItem item = new ListViewItem();              ListViewItem item = new ListViewItem();
93              // process              // process
94              item.Text = p.ProcessInfo.MainModule.ModuleName;              item.Text = p.FileName;
95              if (p.ProcessIcon != null)              if (p.ProcessIcon != null)
96              {              {
97                  Bitmap small_image = ProcContainer.CreateIconFromProcess(p.ProcessInfo, 1);                  Bitmap small_image = ProcContainer.CreateIconFromProcess(p, 1);
98                  Bitmap large_image = ProcContainer.CreateIconFromProcess(p.ProcessInfo, 2);                  Bitmap large_image = ProcContainer.CreateIconFromProcess(p, 2);
99                  small_image_list.Images.Add(p.ProcessInfo.MainModule.FileName, ProcContainer.CreateIconFromProcess(p.ProcessInfo, 1));                  small_image_list.Images.Add(p.FileName, ProcContainer.CreateIconFromProcess(p, 1));
100                  small_image_list.ImageSize = new Size(small_image.Width, small_image.Height);                  small_image_list.ImageSize = new Size(small_image.Width, small_image.Height);
101                  large_image_list.Images.Add(p.ProcessInfo.MainModule.FileName, ProcContainer.CreateIconFromProcess(p.ProcessInfo, 2));                  large_image_list.Images.Add(p.FileName, ProcContainer.CreateIconFromProcess(p, 2));
102                  large_image_list.ImageSize = new Size(large_image.Width, large_image.Height);                  large_image_list.ImageSize = new Size(large_image.Width, large_image.Height);
103                  item.ImageKey = p.ProcessInfo.MainModule.FileName;                  item.ImageKey = p.FileName;
104              }              }
105              // pid              // pid
106              item.SubItems.Add(p.ProcessInfo.Id.ToString());              item.SubItems.Add(p.ProcessInfo.Id.ToString());
107              // FullPath              // FullPath
108              item.SubItems.Add(p.ProcessInfo.MainModule.FileName);              item.SubItems.Add(p.FileName);
109              if (!items.Contains(item)) items.Add(item);              if (!items.Contains(item)) items.Add(item);
110          }          }
111      }      }

Legend:
Removed from v.88  
changed lines
  Added in v.103

  ViewVC Help
Powered by ViewVC 1.1.22