Exemple #1
0
        private void buttonSinhronizacia_Click(object sender, EventArgs e)
        {
            if (openFileSinhronizacia.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            List <List <Player> > SelectedListPlayer = MethodsWorkWithFile.CreateListPlayer(openFileSinhronizacia.SafeFileName);

            MethodsWorkWithFile.Sinhronizacia(GlobalVariables.ListPlayerInDiscypline, SelectedListPlayer);
            MessageBox.Show("Синхронизация прошла успешно", "ОК", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);

            GlobalVariables.ListPlayerInDiscypline = MethodsWorkWithFile.CreateListPlayer("ListPlayer.txt");

            MethodsWorkWithFile.CreateLists(GlobalVariables.ListPlayerInDiscypline);

            GlobalVariables.SearchFullTeam();

            Player[] MyProfiles = MethodsWorkWithFile.ReadMyProfile();
            GlobalVariables.MyProfileDota2 = (Dota2Player)MyProfiles[0];
            GlobalVariables.MyProfileCSGO  = (CSGOPlayer)MyProfiles[1];

            GlobalVariables.ListPlayerInDiscypline[0].Add(GlobalVariables.PlayerDota2Clear);
            GlobalVariables.ListPlayerInDiscypline[0].Add(GlobalVariables.MyProfileDota2);
            GlobalVariables.ListPlayerInDiscypline[1].Add(GlobalVariables.PlayerCSGOClear);
            GlobalVariables.ListPlayerInDiscypline[1].Add(GlobalVariables.MyProfileCSGO);
            GlobalVariables.ListPlayerInDiscyplineSearched = new List <List <Player> >(GlobalVariables.ListPlayerInDiscypline);
        }
Exemple #2
0
        static void Main()
        {
            GlobalVariables.ListPlayerInDiscypline = MethodsWorkWithFile.CreateListPlayer("ListPlayer.txt");

            MethodsWorkWithFile.CreateLists(GlobalVariables.ListPlayerInDiscypline);

            GlobalVariables.SearchFullTeam();

            Player[] MyProfiles = MethodsWorkWithFile.ReadMyProfile();
            GlobalVariables.MyProfileDota2 = (Dota2Player)MyProfiles[0];
            GlobalVariables.MyProfileCSGO  = (CSGOPlayer)MyProfiles[1];

            GlobalVariables.ListPlayerInDiscypline[0].Add(GlobalVariables.PlayerDota2Clear);
            GlobalVariables.ListPlayerInDiscypline[0].Add(GlobalVariables.MyProfileDota2);
            GlobalVariables.ListPlayerInDiscypline[1].Add(GlobalVariables.PlayerCSGOClear);
            GlobalVariables.ListPlayerInDiscypline[1].Add(GlobalVariables.MyProfileCSGO);
            GlobalVariables.ListPlayerInDiscyplineSearched = new List <List <Player> >(GlobalVariables.ListPlayerInDiscypline);

            //MethodsWorkWithFile.WriteFile((Dota2Player)GlobalVariables.ListPlayerInDiscypline[0][5]);
            //MethodsWorkWithFile.WriteFile((Dota2Player)GlobalVariables.ListPlayerInDiscypline[0][0]);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            if (GlobalVariables.ListPlayerInDiscypline != null)
            {
                GlobalVariables.MainFormObject = new MainForm();
                Application.Run(GlobalVariables.MainFormObject);
            }
            //GlobalVariables.MainFormObject = new MainForm();
            //Application.Run(GlobalVariables.MainFormObject);
        }
Exemple #3
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            GlobalVariables.ListPlayerInDiscypline = MethodsWorkWithFile.CreateListPlayer("ListPlayer.txt");

            MethodsWorkWithFile.CreateLists(GlobalVariables.ListPlayerInDiscypline);

            GlobalVariables.SearchFullTeam();

            Player[] MyProfiles = MethodsWorkWithFile.ReadMyProfile();
            GlobalVariables.MyProfileDota2 = (Dota2Player)MyProfiles[0];
            GlobalVariables.MyProfileCSGO  = (CSGOPlayer)MyProfiles[1];

            GlobalVariables.ListPlayerInDiscypline[0].Add(GlobalVariables.PlayerDota2Clear);
            GlobalVariables.ListPlayerInDiscypline[0].Add(GlobalVariables.MyProfileDota2);
            GlobalVariables.ListPlayerInDiscypline[1].Add(GlobalVariables.PlayerCSGOClear);
            GlobalVariables.ListPlayerInDiscypline[1].Add(GlobalVariables.MyProfileCSGO);
            GlobalVariables.ListPlayerInDiscyplineSearched = new List <List <Player> >(GlobalVariables.ListPlayerInDiscypline);
        }
        private void buttonSave_Click(object sender, EventArgs e)
        {
            comboBoxPentagon1.Visible = false;
            comboBoxPentagon2.Visible = false;
            comboBoxPentagon3.Visible = false;
            comboBoxPentagon4.Visible = false;
            comboBoxPentagon5.Visible = false;

            labelPentagon.Visible = true;

            PictureBoxSignature1.Visible = true;
            PictureBoxSignature2.Visible = true;
            PictureBoxSignature3.Visible = true;

            dateTimeDateBirth.Visible = false;
            comboBoxEditHero1.Visible = false;
            comboBoxEditHero2.Visible = false;
            comboBoxEditHero3.Visible = false;

            TextBoxEditName.Visible     = false;
            TextBoxEditSurname.Visible  = false;
            TextBoxEditNickname.Visible = false;
            TextBoxEditTeam.Visible     = false;
            TextBoxEditCity.Visible     = false;
            TextBoxEditCountry.Visible  = false;
            //TextBoxEditCity.Visible = false;
            //TextBoxEditAge.Visible = false;
            TextBoxEditRole.Visible        = false;
            TextBoxEditNumberGames.Visible = false;
            TextBoxEditProcentWin.Visible  = false;
            TextBoxEditMMR.Visible         = false;

            buttonSave.Visible             = false;
            buttonEditPhotoPrifile.Visible = false;

            if (GlobalVariables.SelectedDiscypline == "Dota2")
            {
                Dota2Player tempPlayer   = new Dota2Player(GlobalVariables.MyProfileDota2);
                string      tempName     = String.Copy(tempPlayer.Name);
                string      tempNickname = String.Copy(tempPlayer.Nickname);
                string      tempSurname  = String.Copy(tempPlayer.Surname);

                string tempTeam        = String.Copy(tempPlayer.Team);
                string tempCountry     = String.Copy(tempPlayer.Country);
                string tempCity        = String.Copy(tempPlayer.City);
                string tempNationality = tempCountry;
                string tempDateBirth   = ((tempPlayer.DateBirth.Day < 10) ? ("0" + tempPlayer.DateBirth.Day) : (Convert.ToString(tempPlayer.DateBirth.Day))) + "." + ((tempPlayer.DateBirth.Month < 10) ? ("0" + tempPlayer.DateBirth.Month) : (Convert.ToString(tempPlayer.DateBirth.Month))) + "." + tempPlayer.DateBirth.Year;
                //string tempAge = Convert.ToString(tempPlayer.Age);
                string   tempRole         = String.Copy(tempPlayer.Role);
                string[] tempSignature    = tempPlayer.Signature;
                string   tempNumberGames  = Convert.ToString(tempPlayer.NumberGames);
                string   tempProcentWin   = Convert.ToString(tempPlayer.ProcentWinGames);
                string   tempMMR          = String.Copy(tempPlayer.MMR);
                int[]    tempPentagon     = tempPlayer.Pentagon;
                string   tempPhotoProfile = tempPlayer.PhotoProfile;
                bool     tempEdit         = true;
                string   TempOldNickname  = "";

                if (TextBoxEditName.Text != "")
                {
                    tempName = TextBoxEditName.Text;
                }
                if (TextBoxEditSurname.Text != "")
                {
                    tempSurname = TextBoxEditSurname.Text;
                }
                if (TextBoxEditNickname.Text != "")
                {
                    TempOldNickname = string.Copy(tempNickname);
                    tempNickname    = TextBoxEditNickname.Text;
                }
                if (TextBoxEditTeam.Text != "")
                {
                    tempTeam = TextBoxEditTeam.Text;
                }
                if (TextBoxEditCity.Text != "")
                {
                    tempCity = TextBoxEditCity.Text;
                }
                if (TextBoxEditCountry.Text != "")
                {
                    tempCountry = TextBoxEditCountry.Text;
                }
                if (((dateTimeDateBirth.Value.Day < 10) ? ("0" + dateTimeDateBirth.Value.Day) : (Convert.ToString(dateTimeDateBirth.Value.Day))) + "." + ((dateTimeDateBirth.Value.Month < 10) ? ("0" + dateTimeDateBirth.Value.Month) : (Convert.ToString(dateTimeDateBirth.Value.Month))) + "." + dateTimeDateBirth.Value.Year != "01.01.1900")
                {
                    tempDateBirth = ((dateTimeDateBirth.Value.Day < 10) ? ("0" + dateTimeDateBirth.Value.Day) : (Convert.ToString(dateTimeDateBirth.Value.Day))) + "." + ((dateTimeDateBirth.Value.Month < 10) ? ("0" + dateTimeDateBirth.Value.Month) : (Convert.ToString(dateTimeDateBirth.Value.Month))) + "." + dateTimeDateBirth.Value.Year;
                }
                if (TextBoxEditRole.Text != "")
                {
                    tempRole = TextBoxEditRole.Text;
                }

                if (comboBoxEditHero1.Text != "All")
                {
                    tempSignature[0] = comboBoxEditHero1.Text;
                }
                if (comboBoxEditHero2.Text != "All")
                {
                    tempSignature[1] = comboBoxEditHero2.Text;
                }
                if (comboBoxEditHero3.Text != "All")
                {
                    tempSignature[2] = comboBoxEditHero3.Text;
                }

                if (TextBoxEditNumberGames.Text != "")
                {
                    tempNumberGames = TextBoxEditNumberGames.Text;
                }
                if (TextBoxEditProcentWin.Text != "")
                {
                    tempProcentWin = TextBoxEditProcentWin.Text;
                }
                if (TextBoxEditMMR.Text != "")
                {
                    tempMMR = TextBoxEditMMR.Text;
                }
                if (openFileDialogEditPhotoProfile.FileName != "")
                {
                    tempPhotoProfile = tempNickname + ".png";
                }

                if (comboBoxPentagon1.SelectedItem != null)
                {
                    tempPentagon[0] = (int)comboBoxPentagon1.SelectedItem;
                }
                if (comboBoxPentagon2.SelectedItem != null)
                {
                    tempPentagon[1] = (int)comboBoxPentagon2.SelectedItem;
                }
                if (comboBoxPentagon3.SelectedItem != null)
                {
                    tempPentagon[2] = (int)comboBoxPentagon3.SelectedItem;
                }
                if (comboBoxPentagon4.SelectedItem != null)
                {
                    tempPentagon[3] = (int)comboBoxPentagon4.SelectedItem;
                }
                if (comboBoxPentagon5.SelectedItem != null)
                {
                    tempPentagon[4] = (int)comboBoxPentagon5.SelectedItem;
                }
                buttonSave.Visible = false;

                if (TempOldNickname != "")
                {
                    File.Copy(Environment.CurrentDirectory + @"\image\photoProfiles\" + TempOldNickname + ".png", Environment.CurrentDirectory + @"\image\photoProfiles\" + tempNickname + ".png");
                    File.Delete(Environment.CurrentDirectory + @"\image\photoProfiles\" + TempOldNickname + ".png");
                }
                //MyProfiles[0] = new Dota2Player(new object[] { Dota2Name, Dota2Nickname, Dota2Surname, Dota2Team, Dota2Country, Dota2City, Dota2Nationality, Dota2DateBirth, Dota2Role, Dota2Signature, Dota2NumberGames, Dota2ProcentWinGames, Dota2MMR, Dota2Pentagon, Dota2PhotoProfile });

                GlobalVariables.MyProfileDota2 = new Dota2Player(new object[] { tempName, tempNickname, tempSurname, tempTeam, tempCountry, tempCity, tempNationality, tempDateBirth, tempRole, tempSignature, tempNumberGames, tempProcentWin, tempMMR, tempPentagon, tempPhotoProfile, tempEdit });

                MethodsWorkWithFile.EditFile(tempPlayer, GlobalVariables.MyProfileDota2, "MyProfile.txt");

                GlobalVariables.ListPlayerInDiscypline = MethodsWorkWithFile.CreateListPlayer("ListPlayer.txt");

                MethodsWorkWithFile.CreateLists(GlobalVariables.ListPlayerInDiscypline);

                Player[] MyProfiles = MethodsWorkWithFile.ReadMyProfile();
                GlobalVariables.MyProfileDota2 = (Dota2Player)MyProfiles[0];
                GlobalVariables.MyProfileCSGO  = (CSGOPlayer)MyProfiles[1];

                GlobalVariables.ListPlayerInDiscypline[0].Add(GlobalVariables.PlayerDota2Clear);
                GlobalVariables.ListPlayerInDiscypline[0].Add(GlobalVariables.MyProfileDota2);
                GlobalVariables.ListPlayerInDiscypline[1].Add(GlobalVariables.PlayerCSGOClear);
                GlobalVariables.ListPlayerInDiscypline[1].Add(GlobalVariables.MyProfileCSGO);
                GlobalVariables.ListPlayerInDiscyplineSearched = new List <List <Player> >(GlobalVariables.ListPlayerInDiscypline);

                MyProfile_Load(null, null);
            }
            else
            {
                CSGOPlayer tempPlayer = new CSGOPlayer(GlobalVariables.MyProfileCSGO);
            }
            //MethodsWorkWithFile.EditFile(GlobalVariables.MyProfileDota2, GlobalVariables.MyProfileDota2);
        }