public Wallpaper() { settings = Settings.Default; rnd = new Random(); if (Program.IsVista) { imageConvertor = new WinVistaImageConvertor(); } else { imageConvertor = new WinXpImageConvertor(); } }
internal static void SetTickerInterval(Settings settings) { int minutes = GetIntervalInMiutes(settings.Interval); if (!IsValidInterval(minutes)) { minutes = 30; settings.Interval = "30 Mins"; } else { string hrsPart = (minutes / 60).FormattedTimePart("Hr"), minPart = (minutes % 60).FormattedTimePart("Min"); if (hrsPart.Length > 0 && minPart.Length > 0) { settings.Interval = hrsPart + " " + minPart; } else { settings.Interval = hrsPart.Length > 0 ? hrsPart : minPart; } } settings.Save(); Ticker.Interval = 1000 * 60 * minutes; }