示例#1
0
        public COneRoundResults GetResultsForRound(enRounds round)
        {
            COneRoundResults result = null;

            if (!m_RoundResults.TryGetValue(round, out result))
            {
                result = null;
            }

            return(result);
        }
示例#2
0
        public override void RefreshFrom(ICanRefreshFrom rhs,
                                         bool SkipNullsForObjects,
                                         bool SkipNullsForNullables)
        {
            base.RefreshFrom(rhs, SkipNullsForObjects, SkipNullsForNullables);

            COneRoundResults rhsOneRoundResults = rhs as COneRoundResults;

            if (rhsOneRoundResults == null)
            {
                return;
            }

            if (Route1 == null)
            {
                Route1 = rhsOneRoundResults.Route1;
            }
            else if (rhsOneRoundResults.Route1 == null)
            {
                if (!SkipNullsForObjects)
                {
                    Route1 = null;
                }
            }
            else
            {
                Route1.RefreshFrom(rhsOneRoundResults.Route1, SkipNullsForObjects, SkipNullsForNullables);
            }

            if (Route2 == null)
            {
                Route2 = rhsOneRoundResults.Route2;
            }
            else if (rhsOneRoundResults.Route2 == null)
            {
                if (!SkipNullsForObjects)
                {
                    Route2 = null;
                }
            }
            else
            {
                Route2.RefreshFrom(rhsOneRoundResults.Route2, SkipNullsForObjects, SkipNullsForNullables);
            }

            if (Sum == null)
            {
                Sum = rhsOneRoundResults.Sum;
            }
            else if (rhsOneRoundResults.Sum == null)
            {
                if (!SkipNullsForObjects)
                {
                    Sum = null;
                }
            }
            else
            {
                Sum.RefreshFrom(rhsOneRoundResults.Sum, SkipNullsForObjects, SkipNullsForNullables);
            }

            m_Round      = rhsOneRoundResults.m_Round;
            IsLastMember = rhsOneRoundResults.IsLastMember;
            IsLooser     = rhsOneRoundResults.IsLooser;
        }
示例#3
0
 public void SetResultsForRound(enRounds round, COneRoundResults Results)
 {
     m_RoundResults[round] = Results;
     OnPropertyChanged(PropertyNames[round]);
     OnPropertyChanged(IsLastMemberInAnyRoundPropertyName);
 }
示例#4
0
 public void SetResultsForRound(byte RoundId, COneRoundResults Results)
 {
     SetResultsForRound((enRounds)RoundId, Results);
 }
示例#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
            }
        }