// ------------------- private void OfferToAutomaticallyUpdateIfAppropriate() { bool shouldPrompt = false; if (host.ObjectForUserDefaultsKey(SUConstants.SUEnableAutomaticChecksKey) == null) { object val = host.ObjectForUserDefaultsKey(SUConstants.SUHasLaunchedBeforeKey); if (val == null || (bool)val == false) { host.SetObjectForUserDefaultsKey(true, SUConstants.SUHasLaunchedBeforeKey); } else { shouldPrompt = true; } } if (shouldPrompt) { SUUpdatePermissionPromptWindowController controller = new SUUpdatePermissionPromptWindowController(host); controller.Delegate = this; controller.ShowWindow(); } }
// ------------------- private void OfferToAutomaticallyUpdateIfAppropriate() { bool shouldPrompt = false; if (host.ObjectForUserDefaultsKey(SUConstants.SUEnableAutomaticChecksKey) == null) { object val = host.ObjectForUserDefaultsKey(SUConstants.SUHasLaunchedBeforeKey); if (val == null || (bool)val == false) { host.SetObjectForUserDefaultsKey(true, SUConstants.SUHasLaunchedBeforeKey); //on 1st launch, assume no need to update; shouldPrompt will be true on relaunch KNNotificationCentre.SharedCentre().PostNotificationWithName(SUConstants.SU1stLaunchNotification, this); } else { shouldPrompt = true; } } if (shouldPrompt) { SUUpdatePermissionPromptWindowController controller = new SUUpdatePermissionPromptWindowController(host); controller.Delegate = this; controller.ShowWindow(); } }