ActivEarth.Competition.Contests.ContestTimeGraph.PopulateProgressGraph C# (CSharp) Метод

PopulateProgressGraph() публичный Метод

Sets the progress time has made in the contest.
public PopulateProgressGraph ( System.DateTime contestStartDate, System.DateTime contestEndDate ) : void
contestStartDate System.DateTime The start date of the contest.
contestEndDate System.DateTime The end date of the contest.
Результат void
        public void PopulateProgressGraph(DateTime contestStartDate, DateTime contestEndDate)
        {
            if(DateTime.Compare(contestEndDate, DateTime.Now) > 0)
            {
                TimeSpan contestSpan = contestEndDate - contestStartDate;
                TimeSpan timeCompleted = contestEndDate - DateTime.Now;

                _ContestProgress.Value = (int)(((contestSpan.TotalDays - timeCompleted.TotalDays) / contestSpan.TotalDays) * 100);
            }
            else
            {
                _ContestProgress.Value = 100;
            }
        }

Same methods

ContestTimeGraph::PopulateProgressGraph ( ContestTeam firstPlace, float goal, string format ) : void
ContestTimeGraph