Пример #1
0
        private void Eva_Team_Data_Loaded(object sender, RoutedEventArgs e)
        {
            INIFile tnmtIni = new INIFile(Tournament.iniPath);

            Button[] iA_Buttons =
            {
                btn_CloseTeamGameInfo,
                btn_WindowInfo
            };
            Settings.SwitchColorStyleDefaultButton(iA_Buttons);
            Const.SwitchColor(this);
            SolidColorBrush brush;

            brush = new SolidColorBrush(Const.SwitchFontColor());

            lbl_sGameNr.Foreground          = brush;
            lbl_sTeamPoints.Foreground      = brush;
            lbl_swinPoints.Foreground       = brush;
            lbl_sDiffPoints.Foreground      = brush;
            lbl_oSumDiffPoints.Foreground   = brush;
            lbl_oSumTeamPoints.Foreground   = brush;
            lbl_sAponPoints.Foreground      = brush;
            lbl_sGamePointsTotal.Foreground = brush;
            lbl_sTotal.Foreground           = brush;


            INIFile    gameIni = new INIFile(Game.iniPath);
            Tournament tnmt    = new Tournament();

            tnmt.Getter();

            Data.MinHeight = tnmt.tnmtGameProRunCnt * tnmt.tnmtRunCnt * 28 + 100;

            int gameCnt       = Convert.ToInt32(gameIni.GetValue(Const.fileSec, Game.fsX_gameCnt));
            int playedGameCnt = tnmt.tnmtGameProRunCnt * tnmt.tnmtRunCnt;

            for (int i = 1; i <= gameCnt; i++)
            {
                Game gameOfIni = new Game();
                gameOfIni.Getter(i);

                if (gameOfIni.gameTeams[0] == teamId)
                {
                    FillLable(0, 1, gameOfIni);
                }
                else if (gameOfIni.gameTeams[1] == teamId)
                {
                    FillLable(1, 0, gameOfIni);
                }
            }

            Team team = new Team();

            team.Getter(teamId);

            lbl_oTeamName.Content = team.teamName;
            lbl_oTeamNr.Content   = Convert.ToString(team.teamId);

            lbl_swinPoints.Content = Convert.ToString(team.winPoints);
        }
Пример #2
0
        public LoadOrCreateTournament(MainWindow i_mainWindow)
        {
            InitializeComponent();
            mainWindow = i_mainWindow;

            Const.SwitchColor(i_mainWindow);
            Const.SwitchColor(i_mainWindow);
        }
Пример #3
0
 private void PlayedGameHistory_Loaded(object sender, RoutedEventArgs e)
 {
     Button[] iA_Buttons =
     {
         btn_Close
     };
     Settings.SwitchColorStyleDefaultButton(iA_Buttons);
     Const.SwitchColor(this);
     FillPlayedGameHistory();
 }
Пример #4
0
 private void ChangePassword_Loaded(object sender, RoutedEventArgs e)
 {
     Button[] iA_Btn =
     {
         btn_Save,
         btn_Clear
     };
     Settings.SwitchColorStyleDefaultButton(iA_Btn);
     Const.SwitchColor(this);
 }
Пример #5
0
        private void TeamSwap_Loaded(object sender, RoutedEventArgs e)
        {
            Button[] iA_Buttons =
            {
                btn_Close
            };
            Settings.SwitchColorStyleDefaultButton(iA_Buttons);
            Const.SwitchColor(this);

            btn_Switch.IsEnabled = false;
            SwitchImg.Opacity    = 0.5;

            FillTeamSwap();
        }
Пример #6
0
 public void InfoWindow_Loaded(object sender, RoutedEventArgs e)
 {
     Const.SwitchColor(this);
 }
Пример #7
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            Directory.CreateDirectory(Const.iniFolderPath);

            INIFile logFile           = IniFileDataTemplate.CheckIfIniExists(Log.iniPath);
            INIFile playerData        = IniFileDataTemplate.CheckIfIniExists(Player.iniPath);
            INIFile teamData          = IniFileDataTemplate.CheckIfIniExists(Team.iniPath);
            INIFile tournamentData    = IniFileDataTemplate.CheckIfIniExists(Tournament.iniPath);
            INIFile gameData          = IniFileDataTemplate.CheckIfIniExists(Game.iniPath);
            INIFile tableData         = IniFileDataTemplate.CheckIfIniExists(Table.iniPath);
            INIFile signedUpTeamsData = IniFileDataTemplate.CheckIfIniExists(SignedUpTeam.iniPath);

            actionMenueButton[0] = btn_GoToAddTeam;
            actionMenueButton[1] = btn_GoToEvaluation;
            actionMenueButton[2] = btn_GoToShowTeam;
            actionMenueButton[3] = btn_GoToTnmtData;
            actionMenueButton[4] = btn_GoTournamentMenue;

            Const.SwitchColor(this, actionMenueButton);

            UserControl creOLoaTnmt = new LoadOrCreateTournament(this);

            MainContent.Content = creOLoaTnmt;

            if (!checkIfTournamentIsRuning(tournamentData))
            {
                // No running Tournament! Start New One and get needed Parameters
                //UserControl addTnmt = new AddTournament(this);
                //MainContent.Content = addTnmt;

                Tournament tnmt = new Tournament();
                tnmt.Getter();

                // Set for first run after creating new Tournament
                btn_GoToTnmtData.Style = (Style)Application.Current.Resources["StartTnmtButton"];

                ActionMenue.Visibility   = Visibility.Hidden;
                cnvs_PWHeader.Visibility = Visibility.Visible;
            }
            else if (checkIfTournamentIsInPrepMode(tournamentData))
            {
                UserControl prepMenue = new PrepaireMenue(this);
                MainContent.Content      = prepMenue;
                ActionMenue.Visibility   = Visibility.Hidden;
                cnvs_PWHeader.Visibility = Visibility.Visible;
            }
            else
            {
                UserControl main = new Main(this);
                MainContent.Content = main;

                btn_GoToAddTeam.IsEnabled    = true;
                btn_GoToShowTeam.IsEnabled   = true;
                btn_GoToTnmtData.IsEnabled   = true;
                btn_GoToEvaluation.IsEnabled = true;

                ActionMenue.Visibility   = Visibility.Visible;
                cnvs_PWHeader.Visibility = Visibility.Hidden;

                if (Convert.ToInt32(tournamentData.GetValue(Tournament.tnmtSec, Tournament.tnS_tnmtRunCntAct)) != 0)
                {
                    btn_GoToAddTeam.Style = (Style)Application.Current.Resources["DisabledButton"];
                    addTeamImg.Opacity    = 0.5;
                    btn_GoToAddTeam.Uid   = NO_TEAM_ADDING;
                }

                if (Convert.ToInt32(tournamentData.GetValue(Tournament.tnmtSec, Tournament.tnS_tnmtRunCntAct)) == 0)
                {
                    //btn_GoToTnmtData.Content = "";
                    btn_GoToTnmtData.Style = (Style)Application.Current.Resources["StartTnmtButton"];
                }
                else
                {
                    //btn_GoToTnmtData.Content = "";
                    btn_GoToTnmtData.Style = (Style)Application.Current.Resources["ActionMenueButton_" + tournamentData.GetValue(Const.fileSec, Tournament.fsX_ColorMode)];
                }
            }
        }
Пример #8
0
        private void PlayedGameInfo_Loaded(object sender, RoutedEventArgs e)
        {
            INIFile teamIni  = new INIFile(Team.iniPath);
            INIFile gameIni  = new INIFile(Game.iniPath);
            INIFile tnmtIni  = new INIFile(Tournament.iniPath);
            INIFile tableIni = new INIFile(Table.iniPath);

            Team reqTeam = new Team();

            reqTeam.Getter(pGWd_reqTeamId);

            Button[] iA_Btns =
            {
                btn_ClosePlayedGameInfo
            };
            Settings.SwitchColorStyleDefaultButton(iA_Btns);

            Const.SwitchColor(this);

            Game playedGame = new Game();

            playedGame.Getter(pGWd_gameId);

            Team team1 = new Team();

            team1.Getter(playedGame.gameTeams[0]);
            Team team2 = new Team();

            team2.Getter(playedGame.gameTeams[1]);

            for (int i = 1; i <= Convert.ToInt32(tableIni.GetValue(Const.fileSec, Table.fsX_tableCnt)); i++)
            {
                Table playedTable = new Table();
                playedTable.Getter(i, pGWd_runId);
                for (int x = 0; x < Convert.ToInt32(tnmtIni.GetValue(Tournament.tnmtSec, Tournament.tnS_tnmtGameProRunCnt)); x++)
                {
                    if (playedTable.tableGameIds[x] == playedGame.gameId)
                    {
                        lbl_oGameInfo.Content = pGWd_runId + ". Durchgang / " + playedGame.gameId + ". Spiel | Tisch-Nr.: " + playedTable.tableId;
                        break;
                    }
                }
            }



            lbl_oTeam1.Content = team1.teamName;
            lbl_oTeam2.Content = team2.teamName;

            lbl_oGamePointsTeam1.Content = Convert.ToString(playedGame.gamePoints[0]);
            lbl_oGamePointsTeam2.Content = Convert.ToString(playedGame.gamePoints[1]);

            lbl_sWinOrLost.Content = reqTeam.teamName;

            if (playedGame.gamePoints[0] < playedGame.gamePoints[1])
            {
                if (reqTeam.teamId == playedGame.gameTeams[0])
                {
                    lbl_sWinOrLost.Content += " hat verloren";
                }
                else
                {
                    lbl_sWinOrLost.Content += " hat gewonnen";
                }
            }
            else
            {
                if (reqTeam.teamId == playedGame.gameTeams[0])
                {
                    lbl_sWinOrLost.Content += " hat gewonnen";
                }
                else
                {
                    lbl_sWinOrLost.Content += " hat verloren";
                }
            }
        }
Пример #9
0
        private void PlayedGameInfo_Loaded(object sender, RoutedEventArgs e)
        {
            INIFile teamIni = new INIFile(Team.iniPath);
            INIFile gameIni = new INIFile(Game.iniPath);
            INIFile tnmtIni = new INIFile(Tournament.iniPath);

            Team reqTeam = new Team();

            reqTeam.Getter(pGWd_reqTeamId);

            Button[] iA_Btns =
            {
                btn_ClosePlayedGameInfo
            };
            Settings.SwitchColorStyleDefaultButton(iA_Btns);

            Const.SwitchColor(this);

            Game playedGame = new Game();

            playedGame.Getter(pGWd_gameId);

            Team team1 = new Team();

            team1.Getter(playedGame.gameTeams[0]);
            Team team2 = new Team();

            team2.Getter(playedGame.gameTeams[1]);

            lbl_oGameInfo.Content = pGWd_runId + ". Durchgang / " + playedGame.gameId + ". Spiel";

            lbl_oTeam1.Content = team1.teamName;
            lbl_oTeam2.Content = team2.teamName;

            lbl_oGamePointsTeam1.Content = Convert.ToString(playedGame.gamePoints[0]);
            lbl_oGamePointsTeam2.Content = Convert.ToString(playedGame.gamePoints[1]);

            lbl_sWinOrLost.Content = reqTeam.teamName;

            if (playedGame.gamePoints[0] < playedGame.gamePoints[1])
            {
                if (reqTeam.teamId == playedGame.gameTeams[0])
                {
                    lbl_sWinOrLost.Content += " hat verloren";
                }
                else
                {
                    lbl_sWinOrLost.Content += " hat gewonnen";
                }
            }
            else
            {
                if (reqTeam.teamId == playedGame.gameTeams[0])
                {
                    lbl_sWinOrLost.Content += " hat gewonnen";
                }
                else
                {
                    lbl_sWinOrLost.Content += " hat verloren";
                }
            }
        }