Example #1
0
        } // @ private int GetProcesses()

        #endregion

        #region Events

        private void btnProcessAttach_Click(object sender, System.EventArgs e)
        {
            if (-1 != lbProcessList.SelectedIndex)
            {
                ThisProcess = (POLProcess)lbProcessList.SelectedItem;
                this.Close();
            }
            else
            {
                MessageBox.Show("Please select a process first!");
            }
        }
        /// <summary>
        /// Constructor
        /// </summary>
        internal ProcessSelector()
        {
            InitializeComponent();
            ThisProcess = null;
            error       = false;

            if (0 == p.Length)  //no 'pol' process found, error out
            {
                MessageBox.Show("Please fully log into an FFXI character before trying to start.\r\n\r\nVana'diel times displayed will be estimates before start.", "Error");
                error = true;
                return;
            }
            else if (1 == p.Length)                            //automatically choose 'pol' process if only one running
            {
                if (ignoreThese.IsMatch(p[0].MainWindowTitle)) //if not fully logged in, error out
                {
                    MessageBox.Show("Please fully log into an FFXI character before trying to start.\r\n\r\nVana'diel times displayed will be estimates before start.", "Error");
                    error = true;
                    return;
                }
                else  //attach to the only running 'pol' process, if fully logged in
                {
                    ThisProcess = new POLProcess(p[0].Id, p[0].MainWindowTitle);
                }
            }
            else  //more than one 'pol' process found, fill a ListBox with them to choose from
            {
                int index = GetProcesses();

                if (-1 == index)  //none of the 'pol' processes were actually logged in
                {
                    MessageBox.Show("Please fully log into an FFXI character before trying to start.\r\n\r\nVana'diel times displayed will be estimates before start.", "Error");
                    error = true;
                    return;
                }

                if (-1 < index)  //(index >= 0) means only one of the characters of all the 'pol' processes is logged in
                {
                    ThisProcess = new POLProcess(p[index].Id, p[index].MainWindowTitle);
                }
            }
        } // @ internal ProcessSelector()
        /// <summary>
        /// Constructor
        /// </summary>
        internal ProcessSelector()
        {
            InitializeComponent();

            if(0 == p.Length)  //no 'pol' process found, error out
            {
                MessageBox.Show("Please fully log into your FFXI character before starting!", "Error");
                System.Environment.Exit(0);
            }
            else if(1 == p.Length)  //automatically choose 'pol' process if only one running
            {
                if(ignoreThese.IsMatch(p[0].MainWindowTitle))  //if not fully logged in, error out
                {
                    MessageBox.Show("Please fully log into your FFXI character before starting!", "Error");
                    System.Environment.Exit(0);
                }
                else  //attach to the only running 'pol' process, if fully logged in
                {
                    ThisProcess = new POLProcess(p[0].Id, p[0].MainWindowTitle);
                }
            }
            else  //more than one 'pol' process found, fill a ListBox with them to choose from
            {
                int index = GetProcesses();

                if(-1 == index)  //none of the 'pol' processes were actually logged in
                {
                    MessageBox.Show("Please fully log into your FFXI character before starting!", "Error");
                    System.Environment.Exit(0);
                }

                if(-1 < index)  //(index >= 0) means only one of the characters of all the 'pol' processes is logged in
                {
                    ThisProcess = new POLProcess(p[index].Id, p[index].MainWindowTitle);
                }
            }
        }
Example #4
0
        /// <summary>
        /// Constructor
        /// </summary>
        internal ProcessSelector()
        {
            InitializeComponent();

            if (0 == p.Length)  //no 'pol' process found, error out
            {
                MessageBox.Show("Please fully log into your FFXI character before starting!", "Error");
                System.Environment.Exit(0);
            }
            else if (1 == p.Length)                            //automatically choose 'pol' process if only one running
            {
                if (ignoreThese.IsMatch(p[0].MainWindowTitle)) //if not fully logged in, error out
                {
                    MessageBox.Show("Please fully log into your FFXI character before starting!", "Error");
                    System.Environment.Exit(0);
                }
                else  //attach to the only running 'pol' process, if fully logged in
                {
                    ThisProcess = new POLProcess(p[0].Id, p[0].MainWindowTitle);
                }
            }
            else  //more than one 'pol' process found, fill a ListBox with them to choose from
            {
                int index = GetProcesses();

                if (-1 == index)  //none of the 'pol' processes were actually logged in
                {
                    MessageBox.Show("Please fully log into your FFXI character before starting!", "Error");
                    System.Environment.Exit(0);
                }

                if (-1 < index)  //(index >= 0) means only one of the characters of all the 'pol' processes is logged in
                {
                    ThisProcess = new POLProcess(p[index].Id, p[index].MainWindowTitle);
                }
            }
        } // @ internal ProcessSelector()
 private void btnProcessAttach_Click(object sender, System.EventArgs e)
 {
     if(-1 != lbProcessList.SelectedIndex)
     {
         ThisProcess = (POLProcess)lbProcessList.SelectedItem;
         this.Close();
     }
     else
     {
         MessageBox.Show("Please select a process first!");
     }
 }