private void UpdateBracketsClock(bool FirstLoadWithoutPercent = false) { float Percent = 0; if (FirstLoadWithoutPercent == false) { int NumberOf_N_Brackets = Visual.VisualLeagueEvent.VisualBracketsList.Where(x => x.Bracket.NumberOfContenders >= GeneralBracket.NumberOfContenders).Count(); int NumberOfBrackets = Visual.VisualLeagueEvent.VisualBracketsList.Select(x => x.Bracket).Count(); Percent = (float)(NumberOf_N_Brackets) / (float)NumberOfBrackets; } if (_BracketsClock == null) { _BracketsClock = new GoalsClock(70, 70, Percent); _BracketsClock.OuterCircleWeight = 10; _BracketsClock.InnerCircleWeight = 5; _BracketsClock.InnerCircleColor = GlobalVars.Sys_Yellow; _BracketsClock.OuterCircleColor = Color.FromArgb(78, 78, 78); _BracketsClock.FontColor = GlobalVars.Sys_LabelGray; _BracketsClock.ClockBackGroundColor = splitContainer1.Panel1.BackColor; _BracketsClock.Create(false); _BracketsClock.Clock.Anchor = AnchorStyles.Right | AnchorStyles.Top; _BracketsClock.Clock.Location = new Point(0, 0); lblBracketsClock.Controls.Add(_BracketsClock.Clock); toolTip1.SetToolTip(_BracketsClock.Clock, "אחוז הבתים ששווים או גבוהים ממספר המשתתפים המבוקש לבית"); } else { _BracketsClock.PercentOfGoals = Percent; _BracketsClock.RefreshClock(true); } }
private void UpdateNetoClock(bool FirstLoadWithoutPercent = false) { float Percent = 0; if (FirstLoadWithoutPercent == false) { int ContendersWhithBracket = Visual.VisualLeagueEvent.VisualBracketsList.SelectMany(x => x.Bracket.ContendersList).Count(); int AllContsMinusUseless = (ContendersWhithBracket + Visual.VisualLeagueEvent.VisualUnplacedBracketsList.Select(x => x).Count()) - Visual.VisualLeagueEvent.VisualUnplacedBracketsList.Where(x => x.Contender.IsUseless == true).Count(); Percent = (float)ContendersWhithBracket / (float)AllContsMinusUseless; } if (_MatchWithoutUselessClock == null) { _MatchWithoutUselessClock = new GoalsClock(70, 70, Percent); _MatchWithoutUselessClock.OuterCircleWeight = 10; _MatchWithoutUselessClock.InnerCircleWeight = 5; _MatchWithoutUselessClock.InnerCircleColor = GlobalVars.Sys_Yellow; _MatchWithoutUselessClock.OuterCircleColor = Color.FromArgb(78, 78, 78); _MatchWithoutUselessClock.FontColor = GlobalVars.Sys_LabelGray; _MatchWithoutUselessClock.ClockBackGroundColor = splitContainer1.Panel1.BackColor; _MatchWithoutUselessClock.Create(false); _MatchWithoutUselessClock.Clock.Anchor = AnchorStyles.Right | AnchorStyles.Top; _MatchWithoutUselessClock.Clock.Location = new Point(0, 0); lblPercentwithoutUseless.Controls.Add(_MatchWithoutUselessClock.Clock); toolTip1.SetToolTip(_MatchWithoutUselessClock.Clock, "אחוז המתחרים המשובצים מתוך כלל המשתתפים למעט משתתפים ללא התאמה לאף מתחרה באירוע הנוכחי"); } else { _MatchWithoutUselessClock.PercentOfGoals = Percent; _MatchWithoutUselessClock.RefreshClock(true); } }
private void UpdateStatisticClocks(bool FirstLoadWithoutPercent = false) { float Percent = 0; if (FirstLoadWithoutPercent == false) { int ContendersWhithBracket = Visual.VisualLeagueEvent.VisualBracketsList.SelectMany(x => x.Bracket.ContendersList).Count(); int AllConts = ContendersWhithBracket + Visual.VisualLeagueEvent.VisualUnplacedBracketsList.Select(x => x).Count(); Percent = (float)ContendersWhithBracket / (float)AllConts; // statistics lables lblPlacedContsCount.Text = ContendersWhithBracket.ToString().PadLeft(3, '0'); lblAllContsCount.Text = AllConts.ToString().PadLeft(3, '0'); int allUnplacedConts = Visual.VisualLeagueEvent.VisualUnplacedBracketsList.Select(x => x).Count(); int Useless = Visual.VisualLeagueEvent.VisualUnplacedBracketsList.Where(x => x.Contender.IsUseless == true).Count(); lblIsUselessContsCount.Text = Useless.ToString().PadLeft(3, '0'); if (Useless > allUnplacedConts) { lblAllUnplacedContsCount.Text = (Useless - allUnplacedConts).ToString().PadLeft(3, '0'); } else { lblAllUnplacedContsCount.Text = (allUnplacedConts - Useless).ToString().PadLeft(3, '0'); } } if (_MatchClock == null) { _MatchClock = new GoalsClock(70, 70, Percent); _MatchClock.OuterCircleWeight = 10; _MatchClock.InnerCircleWeight = 5; _MatchClock.InnerCircleColor = GlobalVars.Sys_Yellow; _MatchClock.OuterCircleColor = Color.FromArgb(78, 78, 78); _MatchClock.FontColor = GlobalVars.Sys_LabelGray; _MatchClock.ClockBackGroundColor = splitContainer1.Panel1.BackColor; _MatchClock.Create(false); _MatchClock.Clock.Anchor = AnchorStyles.Right | AnchorStyles.Top; _MatchClock.Clock.Location = new Point(0, 0); lblPercent.Controls.Add(_MatchClock.Clock); toolTip1.SetToolTip(_MatchClock.Clock, "אחוז המתחרים המשובצים מתוך כלל המשתתפים"); } else { _MatchClock.PercentOfGoals = Percent; _MatchClock.RefreshClock(true); } }