Exemplo n.º 1
0
    public void CheckDate()
    {
        string[] date = contentDataManager.LoadDate();
        if (date.Length > 0)
        {
            if (int.Parse(GetValueFromString(date[0])) != currentYear)
            {
                exerciseManager.ClearYears();
                exerciseManager.SaveData();
            }
            if (int.Parse(GetValueFromString(date[1])) != currentMonth)
            {
                exerciseManager.ClearMonths();
                exerciseManager.SaveData();
            }
            if (int.Parse(GetValueFromString(date[2])) != currentWeek)
            {
                exerciseManager.ClearWeeks();
                exerciseManager.SaveData();
            }
            if (int.Parse(GetValueFromString(date[3])) != currentDay)
            {
                exerciseManager.ClearWeeks();
                exerciseManager.SaveData();
            }
        }

        List <string> dateStrings = new List <string>();

        dateStrings.Add("Year[" + currentYear + "]");
        dateStrings.Add("Month[" + currentMonth + "]");
        dateStrings.Add("Week[" + currentWeek + "]");
        dateStrings.Add("Day[" + currentDay + "]");

        contentDataManager.SaveDate(dateStrings.ToArray());
    }