public CConverterResult(CFontStyleSettings fontStyle, bool UseTransparentBackcolor)
 {
     isEmpty    = false;
     FontWeight = fontStyle.FontWeight;
     FontStyle  = fontStyle.FontStyle;
     Background = UseTransparentBackcolor ? Brushes.Transparent : new SolidColorBrush(fontStyle.BackgroundColor);
     Foreground = new SolidColorBrush(fontStyle.ForeColor);
 }
 object ConvResultVal(CFontStyleSettings FontStyleSettings, bool UseTransparentBackcolor)
 {
     if (IsBackgroudColor)
     {
         return(UseTransparentBackcolor ? Brushes.Transparent : new SolidColorBrush(FontStyleSettings.BackgroundColor));
     }
     else
     {
         return(new SolidColorBrush(FontStyleSettings.ForeColor));
     }
 }
Beispiel #3
0
        public CRightPanelControl()
        {
            DataContext = this;

            m_PlainResultsFontStyle          = DBManagerApp.m_AppSettings.m_Settings.PlainResultsFontStyle;
            m_NextRoundMembersCountFontStyle = DBManagerApp.m_AppSettings.m_Settings.NextRoundMembersCountFontStyle;
            m_InvitedToStartFontStyle        = DBManagerApp.m_AppSettings.m_Settings.InvitedToStartFontStyle;
            m_PreparingFontStyle             = DBManagerApp.m_AppSettings.m_Settings.PreparingFontStyle;
            m_StayOnStartFontStyle           = DBManagerApp.m_AppSettings.m_Settings.StayOnStartFontStyle;
            m_JustRecievedResultFontStyle    = DBManagerApp.m_AppSettings.m_Settings.JustRecievedResultFontStyle;
            m_FalsestartFontStyle            = DBManagerApp.m_AppSettings.m_Settings.FalsestartFontStyle;
        }
Beispiel #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="IsWinner">
        /// Необходимо только для 1/8, 1/4, 1/2 и финала.
        /// True - текущий объект описывает победителя
        /// </param>
        public void RefreshColors(bool IsWinner = false)
        {
            CFontStyleSettings RowFontStyle = DBManagerApp.MainWnd.PlainResultsFontStyle;

            switch ((enRounds)DBManagerApp.MainWnd.CurrentRounds.SelectedKey)
            {
            case enRounds.Qualif:
            case enRounds.Qualif2:
                if (Place > 0 && Place <= DBManagerApp.MainWnd.MembersFromQualif)
                {
                    RowFontStyle = DBManagerApp.MainWnd.NextRoundMembersCountFontStyle;
                }
                break;

            case enRounds.OneEighthFinal:
            case enRounds.QuaterFinal:
            case enRounds.SemiFinal:
            case enRounds.Final:
                if (IsWinner)
                {
                    RowFontStyle = DBManagerApp.MainWnd.NextRoundMembersCountFontStyle;
                }
                break;

            default:
                break;
            }

            BackgroundForShow = new SolidColorBrush(RowFontStyle.BackgroundColor);
            ForegroundForShow = new SolidColorBrush(RowFontStyle.ForeColor);
            FontWeightForShow = RowFontStyle.FontWeight;
            FontStyleForShow  = RowFontStyle.FontStyle;

            if (Results != null)
            {
                Results.ResultsForShow.RefreshFields(Results, this, RowFontStyle);
            }
        }
Beispiel #5
0
        public void RefreshFields(CMemberAndResults Member,
                                  COneRoundResults RouteResults,
                                  CResult RouteResult,
                                  CFontStyleSettings RowFontStyle,
                                  out bool PlainStyleSetted)
        {
            MemberInteriorConverter.CConverterResult ConverterResult = new MemberInteriorConverter.CConverterResult(DBManagerApp.m_AppSettings.m_Settings.PlainResultsFontStyle, true);
            PlainStyleSetted = true;
            switch (m_CellType)
            {
            case enCellType.Route1:
            case enCellType.Route2:
            case enCellType.Sum:
                switch (RouteResults.m_Round)
                {
                case enRounds.Qualif:
                case enRounds.Qualif2:
                    ConverterResult = MemberInteriorConverter.Convert(Member,
                                                                      RouteResult,
                                                                      RouteResults.m_Round,
                                                                      DBManagerApp.MainWnd.MembersFromQualif,
                                                                      m_CellType,
                                                                      out PlainStyleSetted);
                    break;

                case enRounds.OneEighthFinal:
                case enRounds.QuaterFinal:
                case enRounds.SemiFinal:
                case enRounds.Final:
                    ConverterResult = MemberInteriorConverter.Convert(Member,
                                                                      RouteResult,
                                                                      RouteResults.m_Round,
                                                                      null,
                                                                      m_CellType,
                                                                      out PlainStyleSetted);
                    break;
                }
                break;

            case enCellType.StartNumber:
                if (RouteResults.m_Round == enRounds.Qualif || RouteResults.m_Round == enRounds.Qualif2)
                {
                    ConverterResult = MemberInteriorConverter.Convert(Member,
                                                                      RouteResult,
                                                                      RouteResults.m_Round,
                                                                      DBManagerApp.MainWnd.MembersFromQualif,
                                                                      m_CellType,
                                                                      out PlainStyleSetted);
                }
                else
                {
                    ConverterResult = MemberInteriorConverter.Convert(Member,
                                                                      RouteResult,
                                                                      RouteResults.m_Round,
                                                                      null,
                                                                      m_CellType,
                                                                      out PlainStyleSetted);
                }
                break;

            case enCellType.SurnameAndName:
                if (RouteResults.m_Round == enRounds.Qualif || RouteResults.m_Round == enRounds.Qualif2)
                {
                    ConverterResult = MemberInteriorConverter.Convert(Member,
                                                                      RouteResult,
                                                                      RouteResults.m_Round,
                                                                      DBManagerApp.MainWnd.MembersFromQualif,
                                                                      m_CellType,
                                                                      out PlainStyleSetted);
                }
                else
                {
                    ConverterResult = MemberInteriorConverter.Convert(Member,
                                                                      RouteResult,
                                                                      RouteResults.m_Round,
                                                                      null,
                                                                      m_CellType,
                                                                      out PlainStyleSetted);
                }
                break;

            default:
                break;
            }

            if (PlainStyleSetted)
            {
                Background = new SolidColorBrush(RowFontStyle.BackgroundColor);
                Foreground = new SolidColorBrush(RowFontStyle.ForeColor);
                FontWeight = RowFontStyle.FontWeight;
                FontStyle  = RowFontStyle.FontStyle;
            }
            else
            {
                Background = ConverterResult.Background;
                Foreground = ConverterResult.Foreground;
                FontWeight = ConverterResult.FontWeight;
                FontStyle  = ConverterResult.FontStyle;
            }
        }
        public void RefreshFields(COneRoundResults RouteResults, CMemberAndResults Parent = null, CFontStyleSettings RowFontStyle = null)
        {
            if (m_Parent == null || Parent != null)
            {
                m_Parent = Parent;
            }
            else
            {
                Parent = m_Parent;
            }

            if (m_RowFontStyle == null || RowFontStyle != null)
            {
                m_RowFontStyle = RowFontStyle;
            }
            else
            {
                RowFontStyle = m_RowFontStyle;
            }

            bool PlainStyleSetted = false;

            Route1.RefreshFields(Parent, RouteResults, RouteResults.Route1, RowFontStyle, out PlainStyleSetted);
            Route2.RefreshFields(Parent, RouteResults, RouteResults.Route2, RowFontStyle, out PlainStyleSetted);
            Sum.RefreshFields(Parent, RouteResults, RouteResults.Sum, RowFontStyle, out PlainStyleSetted);

            StartNumber.RefreshFields(Parent, RouteResults, RouteResults.Route1, RowFontStyle, out PlainStyleSetted);

            SurnameAndName.RefreshFields(Parent, RouteResults, RouteResults.Route1, RowFontStyle, out PlainStyleSetted);

            switch (RouteResults.m_Round)
            {
                #region Qualif, Qualif2
            case enRounds.Qualif:
            case enRounds.Qualif2:
                if (RouteResults.Sum != null && RouteResults.Sum.CondFormating.HasValue)
                {
                    switch (RouteResults.Sum.CondFormating.Value)
                    {
                    case enCondFormating.StayOnStart:       // Находится на старте
                    case enCondFormating.Preparing:         // Участник готовится
                        break;

                    case enCondFormating.JustRecievedResult:         // Только что полученный результат
                        StartNumber.RefreshFields(Parent, RouteResults, RouteResults.Sum, RowFontStyle, out PlainStyleSetted);
                        SurnameAndName.RefreshFields(Parent, RouteResults, RouteResults.Sum, RowFontStyle, out PlainStyleSetted);
                        break;

                    default:
                        break;
                    }
                }
                break;
                #endregion

                #region OneEighthFinal, QuaterFinal, SemiFinal, Final
            case enRounds.OneEighthFinal:
            case enRounds.QuaterFinal:
            case enRounds.SemiFinal:
            case enRounds.Final:
                break;
                #endregion
            }
        }