public override void AwakeFromNib() { base.AwakeFromNib(); updater = new SUUpdater(); updater.AutomaticallyChecksForUpdates = false; UpdateDateLabel(); }
public override bool UpdaterShouldRelaunchApplication(SUUpdater updater) { bool shouldRelaunch = false; bool hasResult = false; Task <bool> task = App.Current.GUIToolkit.Quit(); task.ContinueWith(async(arg) => { shouldRelaunch = await arg; hasResult = true; }); //We need to create a secondary loop because this callback is run in the main thread and we need a secondary //loop in order to not block the main loop while we are quitting the application App.Current.GUIToolkit.RunLoop(() => hasResult); return(shouldRelaunch); }
public MainWindow() { InitializeComponent(); // Load! if (KNUserDefaults.StandardUserDefaults().ObjectForKey("Keys") != null) { foreach (Dictionary <string, object> dict in (ArrayList)KNUserDefaults.StandardUserDefaults().ObjectForKey("Keys")) { keys.Add(new UpdateSigningKey(dict)); } } KNTableView keyTable = new KNTableView(); keyTable.CornerCell = new KNLeopardCornerCell(); KNCell cell = new KNTextCell(); ((KNTextCell)cell).IsEditable = true; KNTableColumnDelegate del = null; KNHeaderCell header = new KNLeopardStyleHeaderCell("Name", false, true, System.Drawing.StringAlignment.Near); KNTableColumn col = new KNTableColumn("name", ref cell, ref header, ref del); col.Width = (int)KeyListHost.Width; keyTable.AddColumn(col); keyTable.TableDelegate = this; keyTable.DataSource = this; keyTable.AlternatingRowBackgrounds = true; keyTable.CellPerformedAction += Action; keyTable.SelectionChanged += TableSelectionChanged; KeyListHost.Child = keyTable; KNLeopardStyleHeaderButton button = new KNLeopardStyleHeaderButton(); button.Enabled = false; ButtonBarHost.Child = button; SUUpdater updater = SUUpdater.SharedUpdater(); this.AddObserverToKeyPathWithOptions(this, "SelectedKey", KNKeyValueObservingOptions.KNKeyValueObservingOptionInitial, null); }
public void Start(string companyName, string appName, string version, string castURL, string baseDir) { try { // This internally calls ObjCRuntime.Runtime.EnsureInitialized () to intialize Xamarin.Mac's internals NSApplication.Init(); string bundlePath = GetBundlePath(); string libPath = Path.GetFullPath(Path.Combine(baseDir, "frameworks", "Sparkle.framework", "Sparkle")); if (Dlfcn.dlopen(libPath, 0) == IntPtr.Zero) { throw new Exception($"Could not load Sparkle.framework {libPath}"); } var bundle = new NSBundle(bundlePath); updater = new SUUpdater(bundle); updater.Delegate = new UpdaterDelegate(); updater.FeedURL = new NSUrl(castURL); updater.AutomaticallyChecksForUpdates = true; updater.UpdateCheckInterval = Constants.APP_UPDATER_INTERVAL_SECONDS; } catch (Exception ex) { Log.Error($"Updater will not start: {ex.Message}"); } }
public override bool UpdaterShouldPromptForPermissionToCheckForUpdates(SUUpdater updater) { return(false); }
private void button1_Click(object sender, RoutedEventArgs e) { SUUpdater.SharedUpdater().CheckForUpdates(); }