/[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

--- trunk/RomCheater/Docking/PIDSelector.cs	2012/05/28 00:17:16	151
+++ trunk/RomCheater/Docking/PIDSelector.cs	2012/05/28 02:01:34	152
@@ -16,10 +16,10 @@
 {
     public partial class PIDSelector : DockContent
     {
-        private IConfigPlugin plugin = null;
+        //private IConfigPlugin plugin = null;
         //bool isInError = false;
         public PIDSelector() { InitializeComponent(); this.SelectedPid = -1; OnSelectedProcessChanged = null; }
-        public PIDSelector(IConfigPlugin plugin) : this() { this.plugin = plugin; }
+        public PIDSelector(IConfigPlugin plugin) : this() { this.ConfigPlugin = plugin; }
         // unsued construtor (it's not implmented, may not be)
         [Obsolete("constructor PIDSelector(int pid) is not implemented", false)]
         public PIDSelector(int pid) : this() { this.SelectedPid = pid; }
@@ -29,6 +29,7 @@
         private int _SelectedPid;
         public int SelectedPid { get { return _SelectedPid; } set { _SelectedPid = value; } }
 
+        public IConfigPlugin ConfigPlugin { get; set; }
 
         public EventHandler<ProcessChangedEventArgs> OnSelectedProcessChanged { get; set; }
         
@@ -47,7 +48,7 @@
         private void PreInitShow(DockPanel panel)
         {
             //if (panel == null) return;
-            if (!this.RefreshList()) { MessageBox.Show(string.Format("Could not find any Processes for plugin {0}.  Please start an instance of one.", plugin.ToString())); }
+            if (!this.RefreshList()) { MessageBox.Show(string.Format("Could not find any Processes for plugin {0}.  Please start an instance of one.", ConfigPlugin.ToString())); }
             else { if (panel == null) { base.Show(); } else { base.Show(panel); } }
         }
         //private DialogResult PreInitDialog(IWin32Window owner)
@@ -86,9 +87,9 @@
         private bool RefreshList()
         {
             lstProcessList.Items.Clear();
-            this.plugin.Reload();
+            this.ConfigPlugin.Reload();
             // create a selection of PCSX2 processes
-            List<ProcContainer> proc_list = plugin.ValidProcessesForPlugin;
+            List<ProcContainer> proc_list = ConfigPlugin.ValidProcessesForPlugin;
 
             if (!(proc_list.Count > 0)) { //MessageBox.Show("Could not find any PCSX2 Processes.  Please start an instance of one."); 
                 return false; }
@@ -168,6 +169,12 @@
             }
 
         }
+
+        private void PIDSelector_Load(object sender, EventArgs e)
+        {
+            if (ConfigPlugin == null || this.DesignMode) return;
+            btnRefresh.PerformClick();
+        }
     }
 
     #region eventargs

 

  ViewVC Help
Powered by ViewVC 1.1.22