Beispiel #1
0
        private void btnSubmitConnectionName_Click(object sender, EventArgs e)
        {
            DesktopApplicationForm daf = new DesktopApplicationForm(currentUserID, connectionNameTextBox.Text, 0, lessonID);

            daf.Show();
            this.Hide();
        }
Beispiel #2
0
        private void pConnectionsGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;

            if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn &&
                e.RowIndex >= 0)
            {
                string requestID = senderGrid.Columns[e.ColumnIndex].Tag.ToString();

                string partnerUsername = itemList[e.RowIndex].RequesterUsername;
                if (!screenShareManager.CheckPartnerAvailability(partnerUsername))
                {
                    MessageBox.Show("Your partner is not available at the moment! You can try again or skip this section!");
                }
                else
                {
                    int reqID = screenShareManager.AcceptScreenShareRequest(int.Parse(requestID), userID);

                    this.Hide();
                    DesktopApplicationForm daf = new DesktopApplicationForm(reqID, userID, "Request");
                    daf.FormClosed += (s, args) => this.Close();
                    daf.Show();
                }
            }
        }
Beispiel #3
0
        private void connectionRequestTimer_Tick(object sender, EventArgs e)
        {
            connectionRequestTimer.Stop();

            int connID = screenShareManager.ControlConnectionForCreation(currentUserID, lessonID /*, Dns.GetHostEntry(Dns.GetHostName()).AddressList[0].ToString(),categoryID*/);    //kontrol et varsa katıl yoksa create et

            if (connID != -1)
            {
                DesktopApplicationForm daf = new DesktopApplicationForm(currentUserID, connectionNameTextBox.Text, connID, lessonID);
                daf.Show();
            }
            else
            {
                if (screenShareManager.HasConnection(currentUserID))
                {
                    btnSubmitConnectionName.Enabled = true;
                    connectionNameTextBox.Enabled   = true;

                    connectionRequestTimer.Start();
                }
                else
                {
                    connectionRequestTimer.Start();
                }
            }
        }
Beispiel #4
0
        private void acceptedRequestTimer_Tick(object sender, EventArgs e)
        {
            acceptedRequestTimer.Stop();
            int connID = screenShareManager.CheckAcceptedRequest(userID);

            if (connID != -1)
            {
                string[] info = screenShareManager.GetAcceptedRequestInfo(connID, userID);

                MessageBox.Show(info[1] + " has accepted your request! Connection again for the connection: " + info[0]);

                Thread.Sleep(3000);

                this.Hide();
                DesktopApplicationForm daf = new DesktopApplicationForm(connID, userID, "Connection");
                daf.FormClosed += (s, args) => this.Close();
                daf.Show();
            }
            else
            {
                acceptedRequestTimer.Start();
            }
        }