Пример #1
0
 internal static string FormatSchedule(Dictionary <string, string> schedule, vmss_frequency backupFrequency, DaysWeekCheckboxes.DaysMode mode)
 {
     if (backupFrequency == vmss_frequency.hourly)
     {
         return(string.Format(Messages.HOURLY_SCHEDULE_FORMAT, schedule["min"]));
     }
     else if (backupFrequency == vmss_frequency.daily)
     {
         DateTime value = DateTime.Parse(string.Format("{0}:{1}", schedule["hour"], schedule["min"]), CultureInfo.InvariantCulture);
         return(string.Format(Messages.DAILY_SCHEDULE_FORMAT, HelpersGUI.DateTimeToString(value, Messages.DATEFORMAT_HM, true)));
     }
     else if (backupFrequency == vmss_frequency.weekly)
     {
         DateTime value = DateTime.Parse(string.Format("{0}:{1}", schedule["hour"], schedule["min"]), CultureInfo.InvariantCulture);
         return(string.Format(Messages.WEEKLY_SCHEDULE_FORMAT, HelpersGUI.DateTimeToString(value, Messages.DATEFORMAT_HM, true), DaysWeekCheckboxes.L10NDays(schedule["days"], mode)));
     }
     return("");
 }
Пример #2
0
 // These two instances of FormatSchedule used to be in the VMPP class. That's probably where
 // they really belong, but because of the way they're constructed (see DaysWeekCheckboxes.L10NDays())
 // they had to move into the View. (CA-51612).
 internal static string FormatSchedule(Dictionary <string, string> schedule, vmpp_archive_frequency archiveType, DaysWeekCheckboxes.DaysMode mode)
 {
     if (archiveType == vmpp_archive_frequency.always_after_backup)
     {
         return(Messages.ASAPSNAPSHOTTAKEN);
     }
     else if (archiveType == vmpp_archive_frequency.never)
     {
         return(Messages.NEVER);
     }
     else if (archiveType == vmpp_archive_frequency.daily)
     {
         DateTime value = DateTime.Parse(string.Format("{0}:{1}", schedule["hour"], schedule["min"]), CultureInfo.InvariantCulture);
         return(string.Format(Messages.DAILY_SCHEDULE_FORMAT, HelpersGUI.DateTimeToString(value, Messages.DATEFORMAT_HM, true)));
     }
     else if (archiveType == vmpp_archive_frequency.weekly)
     {
         DateTime value = DateTime.Parse(string.Format("{0}:{1}", schedule["hour"], schedule["min"]), CultureInfo.InvariantCulture);
         return(string.Format(Messages.WEEKLY_SCHEDULE_FORMAT, HelpersGUI.DateTimeToString(value, Messages.DATEFORMAT_HM, true), DaysWeekCheckboxes.L10NDays(schedule["days"], mode)));
     }
     return("");
 }