コード例 #1
0
ファイル: Form1.cs プロジェクト: SnipeLike/TemPS3
        /*-----------------*/
        /*-----Workers-----*/
        /*-----------------*/

        //BW_connect, Connect to Console in Background
        private void BW_connect_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker BW_connect = sender as BackgroundWorker;

            //Connect CCAPI to PS3 if Button clicked
            PS3.ConnectTarget(psip);

            //Check Connection
            if (PS3.SUCCESS(PS3.ConnectTarget(psip)))
            {
                //Status "Connected!"
                stat_connected();
                PS3.RingBuzzer(CCAPI.BuzzerMode.Single);

                //Start Backgroundworker to get Data
                BW_psdata.RunWorkerAsync();

                //Show Status
                MessageBox.Show("Connected to: " + psip + "!", "Connected");
            }
            else
            {
                //Status "Not Connected!"
                stat_notconnected();

                //Show Status
                MessageBox.Show("Failed to Connect to: " + psip + "!", "Connection Error");
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: SnipeLike/TemPS3
 public void timer1_Tick(object sender, EventArgs e)
 {
     if (!BW_psdata.IsBusy)
     {
         //Start Backgroundworker to refresh PS Status
         BW_psdata.RunWorkerAsync();
     }
     //get_psdata();
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: SnipeLike/TemPS3
        //B_disconnect, Disconnect PS3
        private void B_disconnect_Click(object sender, EventArgs e)
        {
            //Check connection & disconnect
            if (psstatus == 1)
            {
                PS3.RingBuzzer(CCAPI.BuzzerMode.Double);
                PS3.DisconnectTarget();

                //Start Backgroundworker to Reset Connection
                BW_psdata.RunWorkerAsync();

                //Show Status
                stat_notconnected();
                MessageBox.Show("Disconnected from " + psip + "!", "Disconnected");
            }
            else
            {
                MessageBox.Show("No PS3 Connected!", "Disconnection Error");
            }
        }