コード例 #1
0
        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
            {
            }
        }
コード例 #2
0
 public UpdateForm(AudioSwitcherVersionInfo vi)
 {
     InitializeComponent();
     url       = vi.URL;
     changelog = vi.ChangeLog;
     toolTip1.SetToolTip(linkLabel1, url);
 }
コード例 #3
0
        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);
                    }
                }
            }
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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!");
                }
            }
        }