Exemplo n.º 1
0
 public static void SetTimeTextForDayOfWeek(UILabel label, int totalSeconds, DateTime restTimeDate, bool useDateFormat = true)
 {
     if (totalSeconds > 0)
     {
         GUIBannerParts.SetActiveRestTime(true, label);
         int num  = totalSeconds / GUIBannerParts.DAY_SECONDS;
         int num2 = (totalSeconds - GUIBannerParts.DAY_SECONDS * num) / GUIBannerParts.HOUR_SECONDS;
         int num3 = (totalSeconds - GUIBannerParts.DAY_SECONDS * num - GUIBannerParts.HOUR_SECONDS * num2) / GUIBannerParts.MINUTES_SECONDS;
         int num4 = totalSeconds % GUIBannerParts.MINUTES_SECONDS;
         if (useDateFormat && 1 <= num)
         {
             GUIBannerParts.SetDateFormat(label, restTimeDate);
         }
         else if (num2 >= 1)
         {
             label.text = string.Format(StringMaster.GetString("CountDownHM"), num2 + GUIBannerParts.DAY_HOUR * num, num3);
         }
         else if (num3 >= 1)
         {
             label.text = string.Format(StringMaster.GetString("CountDownMS"), num3, num4);
         }
         else
         {
             label.text = string.Format(StringMaster.GetString("CountDownS"), num4);
         }
     }
     else
     {
         GUIBannerParts.SetActiveRestTime(true, label);
         label.text = StringMaster.GetString("CountDownEnd");
     }
 }