ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater/Docking/PIDSelector.cs
(Generate patch)

Comparing trunk/RomCheater/Docking/PIDSelector.cs (file contents):
Revision 155 by william, Mon May 28 02:20:29 2012 UTC vs.
Revision 156 by william, Mon May 28 04:14:03 2012 UTC

# Line 62 | Line 62 | namespace RomCheater.Docking
62          private void btnList_Click(object sender, EventArgs e) { this.lstProcessList.View = View.List; }
63          private void btnTile_Click(object sender, EventArgs e) { this.lstProcessList.View = View.Tile; }
64  
65 <        private void btnOK_Click(object sender, EventArgs e)
65 >        private void PerformListViewItemSelect(ListViewItem li)
66          {
67 <            if (!(lstProcessList.SelectedItems.Count > 0)) return;
68 <            this.SelectedPid = Convert.ToInt32(lstProcessList.SelectedItems[0].SubItems[1].Text);
67 >            this.SelectedPid = Convert.ToInt32(li.SubItems[1].Text);
68              //this.Close();
69              if (this.OnSelectedProcessChanged != null)
70              {
71                  this.OnSelectedProcessChanged(this, new ProcessChangedEventArgs(this.SelectedPid));
72              }
73 +            Process SelectedProcess = Process.GetProcessById(this.SelectedPid);
74 +            logger.Debug.WriteLine("Using Process: ({0} : {1})", SelectedProcess.Id, SelectedProcess.ProcessName);
75 +        }
76 +        private void btnOK_Click(object sender, EventArgs e)
77 +        {
78 +            
79          }
80  
81          //private void btnCancel_Click(object sender, EventArgs e)
# Line 126 | Line 131 | namespace RomCheater.Docking
131                  }
132                  else
133                  {
134 <                    logger.Error.Write("image_key is an empty string!");
135 <                    if (small_image != null) { logger.Error.Write(" [however small_image is not null]"); }
136 <                    if (large_image != null) { logger.Error.Write(" [however large_image is not null]\n"); }
134 >                    //logger.Error.WriteLine("image_key is an empty string!");
135 >                    //if (small_image != null) { logger.Error.WriteLine(" [however small_image is not null]"); }
136 >                    //if (large_image != null) { logger.Error.WriteLine(" [however large_image is not null]\n"); }
137                  }
138              }
139              lstProcessList.SmallImageList = small_image_list;
140              lstProcessList.LargeImageList = large_image_list;
141              this.lstProcessList.Items.AddRange(items.ToArray());
142 +
143 +            if (lstProcessList.Items.Count > 0)
144 +            {
145 +                lstProcessList.Items[0].Selected = true;
146 +            }
147 +
148              return true;
149          }
150  
# Line 175 | Line 186 | namespace RomCheater.Docking
186              if (AcceptedPlugin == null || this.DesignMode) return;
187              btnRefresh.PerformClick();
188          }
189 +
190 +
191 +        private void lstProcessList_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
192 +        {
193 +            if (!e.IsSelected) return;
194 +            PerformListViewItemSelect(e.Item);
195 +        }
196 +
197 +        private void lstProcessList_ItemActivate(object sender, EventArgs e)
198 +        {
199 +            ListViewItem Item = lstProcessList.SelectedItems[0];
200 +            PerformListViewItemSelect(Item);
201 +        }
202 +
203 +
204      }
205  
206      #region eventargs

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines