Esempio n. 1
0
 public void CallMe(bool AfterSecuredWorkingOver = false)
 {
     if (!AfterSecuredWorkingOver)
     {
         //This part should run shortly after appearance of the SandBox
         //And should prepare the yui sandbox and checking for existance and etc..
         IsCheckingForExisting = true;
         //bool result = false;
         Me theMe = new Me(ProfileInf.UserName, ProfileInf.TheToken);
         ThereIsServer.ServerSettings.MyProfile = theMe;
         IsShowingAnotherSandBox = true;
         LoadingSandBox          = new YuiLoadingSandbox(this);
         LoadingSandBox.Location = new Point((Screen.PrimaryScreen.Bounds.Size.Width / 2) -
                                             (LoadingSandBox.Width / 2), (Screen.PrimaryScreen.Bounds.Size.Height / 2) -
                                             (LoadingSandBox.Height / 2));
         LoadingSandBox.FormClosed += LoadingSandBox_FormClosed;
         LoadingSandBox.Show();
     }
     else
     {
         //However, this part should run when the secured working has ended already...
         //And should be called in the thereIsServer class
         IsSignInEnded = false;
         //Texts:
         MessageLabel1.SetLabelText(ProfileInf.UserName);
         TextBox1.SetTextBoxText(ProfileInf.LastLogin);
         //Events:
         MessageLabel4.AddClickEventToAllChild(ButtonControl2_Click);
     }
 }
Esempio n. 2
0
 private void LogoutWarningButtonControl2_Click1(object sender, EventArgs e)
 {
     if (ShowingAnotherSandBox is NoInternetConnectionSandBox mySandBox)
     {
         mySandBox.ClosedForRetry = true;
         mySandBox.Close();
     }
     ThereIsServer.GameObjects.MyProfile.LogOut();
     IsShowingAnotherSandBox = true;
     ShowingAnotherSandBox   =
         LoadingSandBox      = new YuiLoadingSandbox(this);
     LoadingSandBox.Location =
         new Point((Screen.PrimaryScreen.Bounds.Size.Width / 2) -
                   (LoadingSandBox.Width / 2),
                   (Screen.PrimaryScreen.Bounds.Size.Height / 2) -
                   (LoadingSandBox.Height / 2));
     LoadingSandBox.FormClosed += LoadingSandBox_FormClosed;
     LoadingSandBox.Show();
 }
Esempio n. 3
0
        private void ButtonControl2_Click(object sender, EventArgs e)
        {
            if (IsLinkStartMode) //for LinkStart Label Click Event
            {
                IsCheckingForExisting = true;
                if ((bool)this.MessageLabel4.Tag)
                {
                    return;
                }
                else
                {
                    this.MessageLabel4.Tag = false;
                }
                //bool result = false;

                /*
                 * Me theNewAcc = new Me(false, TextBox1.Text, TextBox2.Text);
                 * ThereIsServer.ServerSettings.MyProfile = theNewAcc;
                 */


                ThereIsServer.GameObjects.MyProfile.Link_Start(true);
                IsShowingAnotherSandBox = true;
                ShowingAnotherSandBox   = LoadingSandBox = new YuiLoadingSandbox(this);
                LoadingSandBox.Location =
                    new Point((Screen.PrimaryScreen.Bounds.Size.Width / 2) -
                              (LoadingSandBox.Width / 2),
                              (Screen.PrimaryScreen.Bounds.Size.Height / 2) -
                              (LoadingSandBox.Height / 2));
                LoadingSandBox.FormClosed += LoadingSandBox_FormClosed;
                LoadingSandBox.Show();
            }
            else
            {
                if (ButtonControl2.ForeColor == Color.LightGreen)
                {
                    if (IsSignInMode)
                    {
                        IsCheckingForExisting = true;
                        //bool result = false;
                        Me theNewAcc = new Me(false, TextBox1.Text, TextBox2.Text);
                        ThereIsServer.ServerSettings.MyProfile = theNewAcc;
                        IsShowingAnotherSandBox = true;
                        ShowingAnotherSandBox   = LoadingSandBox =
                            new YuiLoadingSandbox(this);
                        LoadingSandBox.Location =
                            new Point((Screen.PrimaryScreen.Bounds.Size.Width / 2) -
                                      (LoadingSandBox.Width / 2),
                                      (Screen.PrimaryScreen.Bounds.Size.Height / 2) -
                                      (LoadingSandBox.Height / 2));
                        LoadingSandBox.FormClosed += LoadingSandBox_FormClosed;
                        LoadingSandBox.Show();
                    }
                    else if (IsCreatingMode)
                    {
                        IsCheckingForExisting = true;
                        Me theNewAcc = new Me(true, TextBox1.Text, TextBox2.Text);
                        ThereIsServer.ServerSettings.MyProfile = theNewAcc;
                        IsShowingAnotherSandBox = true;
                        ShowingAnotherSandBox   = LoadingSandBox =
                            new YuiLoadingSandbox(this);
                        LoadingSandBox.Location = new Point((Screen.PrimaryScreen.Bounds.Size.Width / 2) -
                                                            (LoadingSandBox.Width / 2), (Screen.PrimaryScreen.Bounds.Size.Height / 2) -
                                                            (LoadingSandBox.Height / 2));
                        LoadingSandBox.FormClosed += LoadingSandBox_FormClosed;
                        LoadingSandBox.Show();
                        if (ThereIsConstants.Forming.TheMainForm.SoundPlayer != null)
                        {
                            ThereIsConstants.Forming.TheMainForm.SoundPlayer.Stop();
                        }
                    }
                }
            }
        }