示例#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()
        {
            InitializeComponent();
            using (AudioSwitcherService.AudioSwitcher client = ConnectionHelper.GetAudioSwitcherProxy())
            {
                if (client == null)
                {
                    return;
                }

                url = client.CheckForUpdate(AudioSwitcher.Instance.AssemblyVersion);
            }
        }
示例#3
0
        private void btnReport_Click(object sender, EventArgs e)
        {
            try
            {
                var p = new Ping();
                p.Send(new Uri(Resources.WebServiceURL).Host);

                //using (Cursor = Cursors.WaitCursor)
                using (AudioSwitcherService.AudioSwitcher client = ConnectionHelper.GetAudioSwitcherProxy())
                {
                    if (client == null)
                    {
                        return;
                    }

                    Assembly asm     = Assembly.GetExecutingAssembly();
                    object[] attribs = (asm.GetCustomAttributes(typeof(GuidAttribute), true));
                    string   guid    = (attribs[0] as GuidAttribute).Value;

                    string body = "";
                    body += "Audio Switcher" + Environment.NewLine;
                    body += "Version: " + Assembly.GetExecutingAssembly().GetName().Version + Environment.NewLine;
                    body += "Operating System: " + Environment.OSVersion + (IntPtr.Size == 8 ? " 64-bit" : " 32-bit") +
                            Environment.NewLine;
                    body += "Administrator Privileges: " + IsUserAdministrator() + Environment.NewLine;
                    body += "Client Email Address: " + txtEmail.Text + Environment.NewLine;

                    string x = client.SendBugReport(guid, txtErrorDetails.Text, body, exception.ToString());

                    if (x != "")
                    {
                        MessageBox.Show(this, "Bug Report Received. Thank you!\r\nBug ID: " + x);
                        Close();
                    }
                    else
                    {
                        MessageBox.Show(this, "Error Sending bug report. Please try again later");
                    }
                }
            }
            catch
            {
                MessageBox.Show("Error Sending bug report. Please try again later");
            }
        }
示例#4
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!");
                }
            }
        }