Esempio n. 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);
        }
Esempio n. 2
0
        public void Evaluation_Loaded(object sender, RoutedEventArgs e)
        {
            INIFile teamIni = new INIFile(Team.iniPath);
            INIFile tnmtIni = new INIFile(Tournament.iniPath);

            Button[] iA_Btns =
            {
                btn_MainMenue,
                btn_PrintEvaluation
            };

            Settings.SwitchColorStyleDefaultButton(iA_Btns);

            if (CheckTnmtNotFinishState(tnmtIni))
            {
                lbl_oTnmtFinishStatement.Visibility = Visibility.Visible;
            }
            else
            {
                lbl_oTnmtFinishStatement.Visibility = Visibility.Hidden;
            }

            SolidColorBrush brush;

            brush = new SolidColorBrush(Const.SwitchFontColor());
            lbl_sPosHeader.Foreground        = brush;
            lbl_sTeamHeader.Foreground       = brush;
            lbl_sWinPointsHeader.Foreground  = brush;
            lbl_sGamePointsHeader.Foreground = brush;
            lbl_sInfoHeader.Foreground       = brush;


            if (Convert.ToInt32(teamIni.GetValue(Const.fileSec, Team.fsX_teamCnt)) != 0)
            {
                Team[] allTeams = new Team[Convert.ToInt32(teamIni.GetValue(Const.fileSec, Team.fsX_teamCnt))];

                for (int i = 0; i < allTeams.Length; i++)
                {
                    Team addTeam = new Team();
                    addTeam.Getter(i + 1);
                    allTeams[i] = addTeam;
                }

                SortTeamsByWinAndGamePoints(allTeams);

                Label lbl_rowNumber      = new Label();
                Label lbl_teamName       = new Label();
                Label lbl_winPoints      = new Label();
                Label lbl_gamePointsDiff = new Label();

                int x = 0;
                last = allTeams.Length;

                tabelLabel = new Label[allTeams.Length, 4];

                //do
                //{
                foreach (Team team in allTeams)
                {
                    #region create Button n Lable for Table
                    Separator sep = new Separator();
                    Button    btn_teamGameInfo = new Button();
                    x++;
                    lbl_rowNumber      = new Label();
                    lbl_teamName       = new Label();
                    lbl_winPoints      = new Label();
                    lbl_gamePointsDiff = new Label();

                    //lbl_rowNumber.Background = Brushes.Transparent;
                    //lbl_teamName.Background = Brushes.Transparent;
                    //lbl_winPoints.Background = Brushes.Transparent;
                    //lbl_gamePointsDiff.Background = Brushes.Transparent;

                    lbl_rowNumber.Style      = (Style)Application.Current.Resources["EvaCellDefLabel"];
                    lbl_teamName.Style       = (Style)Application.Current.Resources["EvaCellDefLabel"];
                    lbl_winPoints.Style      = (Style)Application.Current.Resources["EvaCellDefLabel"];
                    lbl_gamePointsDiff.Style = (Style)Application.Current.Resources["EvaCellDefLabel"];

                    lbl_rowNumber.Content      = Convert.ToString(x);
                    lbl_teamName.Content       = team.teamName;
                    lbl_winPoints.Content      = Convert.ToString(team.winPoints);
                    lbl_gamePointsDiff.Content = Convert.ToString(team.gamePointsTotalDiff);

                    lbl_rowNumber.Uid      = Convert.ToString(x);
                    lbl_teamName.Uid       = Convert.ToString(x);
                    lbl_winPoints.Uid      = Convert.ToString(x);
                    lbl_gamePointsDiff.Uid = Convert.ToString(x);

                    lbl_rowNumber.MouseEnter      += new MouseEventHandler(MarkUpActRow);
                    lbl_teamName.MouseEnter       += new MouseEventHandler(MarkUpActRow);
                    lbl_winPoints.MouseEnter      += new MouseEventHandler(MarkUpActRow);
                    lbl_gamePointsDiff.MouseEnter += new MouseEventHandler(MarkUpActRow);
                    lbl_rowNumber.MouseLeave      += new MouseEventHandler(MarkDownActRow);
                    lbl_teamName.MouseLeave       += new MouseEventHandler(MarkDownActRow);
                    lbl_winPoints.MouseLeave      += new MouseEventHandler(MarkDownActRow);
                    lbl_gamePointsDiff.MouseLeave += new MouseEventHandler(MarkDownActRow);

                    btn_teamGameInfo.Uid         = Convert.ToString(team.teamId) + "|" + Convert.ToString(x);
                    btn_teamGameInfo.Content     = "i";
                    btn_teamGameInfo.Height      = 31.28;
                    btn_teamGameInfo.FontWeight  = FontWeights.Bold;
                    btn_teamGameInfo.FontFamily  = new FontFamily("Courier New");
                    btn_teamGameInfo.FontSize    = 16;
                    btn_teamGameInfo.Foreground  = Brushes.WhiteSmoke;
                    btn_teamGameInfo.Style       = (Style)Application.Current.Resources["InfoButton"];
                    btn_teamGameInfo.Click      += new RoutedEventHandler(OpenTeamGameInfo);
                    btn_teamGameInfo.MouseEnter += new MouseEventHandler(MarkUpActRow);
                    btn_teamGameInfo.MouseLeave += new MouseEventHandler(MarkDownActRow);

                    //lbl_rowNumber.FontSize = 16;
                    //lbl_teamName.FontSize = 16;
                    //lbl_winPoints.FontSize = 16;
                    //lbl_gamePointsDiff.FontSize = 16;

                    lbl_rowNumber.HorizontalContentAlignment      = HorizontalAlignment.Right;
                    lbl_teamName.HorizontalContentAlignment       = HorizontalAlignment.Center;
                    lbl_winPoints.HorizontalContentAlignment      = HorizontalAlignment.Center;
                    lbl_gamePointsDiff.HorizontalContentAlignment = HorizontalAlignment.Center;
                    #endregion

                    if (x == last)
                    {
                        lbl_rowNumber.Style      = (Style)Application.Current.Resources["EvaCellFlopsLabel"];
                        lbl_teamName.Style       = (Style)Application.Current.Resources["EvaCellFlopsLabel"];
                        lbl_winPoints.Style      = (Style)Application.Current.Resources["EvaCellFlopsLabel"];
                        lbl_gamePointsDiff.Style = (Style)Application.Current.Resources["EvaCellFlopsLabel"];
                    }

                    if (x >= 1 && x <= 3)
                    {
                        lbl_rowNumber.Style      = (Style)Application.Current.Resources["EvaCellTopsLabel"];
                        lbl_teamName.Style       = (Style)Application.Current.Resources["EvaCellTopsLabel"];
                        lbl_winPoints.Style      = (Style)Application.Current.Resources["EvaCellTopsLabel"];
                        lbl_gamePointsDiff.Style = (Style)Application.Current.Resources["EvaCellTopsLabel"];
                    }

                    tabelLabel[x - 1, 0] = lbl_rowNumber;
                    tabelLabel[x - 1, 1] = lbl_teamName;
                    tabelLabel[x - 1, 2] = lbl_winPoints;
                    tabelLabel[x - 1, 3] = lbl_gamePointsDiff;

                    #region add Button n Lable to Table
                    stp_posNumber.Children.Add(lbl_rowNumber);
                    sep = new Separator();
                    stp_posNumber.Children.Add(sep);

                    stp_TeamName.Children.Add(lbl_teamName);
                    sep = new Separator();
                    stp_TeamName.Children.Add(sep);

                    stp_WinPoints.Children.Add(lbl_winPoints);
                    sep = new Separator();
                    stp_WinPoints.Children.Add(sep);

                    stp_GamePointsDiff.Children.Add(lbl_gamePointsDiff);
                    sep = new Separator();
                    stp_GamePointsDiff.Children.Add(sep);

                    stp_TeamGameInfo.Children.Add(btn_teamGameInfo);
                    sep = new Separator();
                    stp_TeamGameInfo.Children.Add(sep);
                    #endregion
                }
            }
        }