private void CheckForUpdates(object o, EventArgs ae) { try { using (AudioSwitcherService.AudioSwitcher client = ConnectionHelper.GetAudioSwitcherProxy()) { if (client == null) { return; } retrievedVersion = client.GetUpdateInfo(AssemblyVersion); if (retrievedVersion != null && !string.IsNullOrEmpty(retrievedVersion.URL)) { notifyIcon1.BalloonTipText = "Click here to download."; notifyIcon1.BalloonTipTitle = "New version available."; notifyIcon1.BalloonTipClicked += notifyIcon1_BalloonTipClicked; notifyIcon1.ShowBalloonTip(3000); } } } catch { } }
public UpdateForm(AudioSwitcherVersionInfo vi) { InitializeComponent(); url = vi.URL; changelog = vi.ChangeLog; toolTip1.SetToolTip(linkLabel1, url); }
private void CheckForNewVersion() { statusLabelUpdate.Visible = false; using (var client = ConnectionHelper.GetAudioSwitcherProxy()) { if (client == null) { return; } _retrievedVersion = client.GetUpdateInfo(AssemblyVersion); if (_retrievedVersion != null && !string.IsNullOrEmpty(_retrievedVersion.URL)) { _updateAvailable = true; statusLabelUpdate.Visible = true; statusLabelUpdate.ToolTipText = "New Version Available - " + _retrievedVersion.VersionInfo; BeginInvoke(new Action(RefreshNotifyIconItems)); if (Program.Settings.UpdateNotificationsEnabled) { ShowUpdateNotification(_retrievedVersion); } } } }
private void ShowUpdateNotification(AudioSwitcherVersionInfo retrievedVersion) { if (InvokeRequired) { BeginInvoke(new Action(() => ShowUpdateNotification(retrievedVersion))); return; } notifyIcon1.BalloonTipText = "Click here to update to " + retrievedVersion.VersionInfo; notifyIcon1.BalloonTipTitle = "Audio Switcher Update"; notifyIcon1.BalloonTipClicked += (s, e) => { ShowUpdateForm(); }; notifyIcon1.ShowBalloonTip(3000); }
private void btnCheckUpdate_Click(object sender, EventArgs e) { using (AudioSwitcherService.AudioSwitcher client = ConnectionHelper.GetAudioSwitcherProxy()) { if (client == null) { return; } AudioSwitcherVersionInfo vi = client.GetUpdateInfo(AssemblyVersion); if (vi != null && !string.IsNullOrEmpty(vi.URL)) { var udf = new UpdateForm(vi); udf.ShowDialog(this); } else { MessageBox.Show(this, "You have the latest version!"); } } }