コード例 #1
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();
                }
            }
        }
コード例 #2
0
        private void connectionCheckerTimer_Tick(object sender, EventArgs e)
        {
            connectionCheckerTimer.Stop();
            connectionID = connectionID != 0 ? connectionID : screenShareManager.ControlConnectionForCreation(currentUserID, lessonID); //var olan bir connection varsa ona katlılmaya çalış

            //string myIP = Dns.GetHostEntry(Dns.GetHostName()).AddressList[0].ToString();

            if (connectionID != -1)
            {
                openForm();
            }
            else
            {
                connectionID = screenShareManager.CreateConnection(currentUserID, connectionName, lessonID);//yeni connection oluştur ve başka bir kullanıcı bekle
                secondConnectionCheckerTimer.Start();
            }
        }
コード例 #3
0
 public int ControlConnectionForCreation(int userID, int lessonID) //random bir connection bul ve kullanıcıyı ona ekle
 {
     return(screenShareComplexManager.ControlConnectionForCreation(userID, lessonID));
 }