Beispiel #1
0
        /// <summary>
        /// Check for Updates.
        /// </summary>
        public static void CheckForUpdates()
        {
            IUserSettingService userSettingService = IoC.Get <IUserSettingService>();

            userSettingService.SetUserSetting(UserSettingConstants.LastUpdateCheckDate, DateTime.Now);
            string url = userSettingService.GetUserSetting <string>(ASUserSettingConstants.HandBrakePlatform).Contains("x86_64")
                                                  ? userSettingService.GetUserSetting <string>(UserSettingConstants.Appcast_x64)
                                                  : userSettingService.GetUserSetting <string>(UserSettingConstants.Appcast_i686);

            UpdateService.BeginCheckForUpdates(UpdateCheckDoneMenu, false,
                                               url, userSettingService.GetUserSetting <int>(ASUserSettingConstants.HandBrakeBuild),
                                               userSettingService.GetUserSetting <int>(UserSettingConstants.Skipversion));
        }
Beispiel #2
0
        /// <summary>
        /// Perform a startup update check. Abiding by user settings.
        /// </summary>
        public static void PerformStartupUpdateCheck()
        {
            // Make sure it's running on the calling thread
            IUserSettingService userSettingService = IoC.Get <IUserSettingService>();

            if (userSettingService.GetUserSetting <bool>(UserSettingConstants.UpdateStatus))
            {
                if (DateTime.Now.Subtract(userSettingService.GetUserSetting <DateTime>(UserSettingConstants.LastUpdateCheckDate)).TotalDays
                    > userSettingService.GetUserSetting <int>(UserSettingConstants.DaysBetweenUpdateCheck))
                {
                    userSettingService.SetUserSetting(UserSettingConstants.LastUpdateCheckDate, DateTime.Now);
                    string url = userSettingService.GetUserSetting <string>(ASUserSettingConstants.HandBrakePlatform).Contains("x86_64")
                                                          ? userSettingService.GetUserSetting <string>(UserSettingConstants.Appcast_x64)
                                                          : userSettingService.GetUserSetting <string>(UserSettingConstants.Appcast_i686);
                    UpdateService.BeginCheckForUpdates(UpdateCheckDone, false,
                                                       url, userSettingService.GetUserSetting <int>(ASUserSettingConstants.HandBrakeBuild),
                                                       userSettingService.GetUserSetting <int>(UserSettingConstants.Skipversion));
                }
            }
        }