Exemple #1
0
        private void btnConfig_Click(object sender, EventArgs e)
        {
            try
            {
                frmSettings  frm = new frmSettings(this.optset);
                DialogResult res = frm.ShowDialog(this);
                sm.AppSettingsObject = frm.Settings;
                sm.WriteConfig();
                sm.ReadConfig();
                this.optset = (LocalAppSettings)sm.AppSettingsObject;
                frm.Dispose();
                this.BringToFront();
                this.txtUsername.Text  = optset.Username;
                this.txtPassword.Text  = optset.Password;
                this.lblExtension.Text = optset.PhoneExt;

                this.UpdateOutboundContextes();

                this.localizator.Culture = this.optset.Language;
                this.localizator.Localize(this);
                UpdateTooltips();
                this.FormSetFont();

                if (this.noOpTimer != null)
                {
                    this.noOpTimer.Interval = this.optset.SocketTimeout;
                }
                // this should refresh the socketmanager
                if (this.socketmanager != null)
                {
                    this.socketmanager.Host = this.optset.Host;
                    this.socketmanager.Port = this.optset.Port;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Exemple #2
0
        private void btnConfig_Click(object sender, EventArgs e)
        {
            try
            {

                frmSettings frm = new frmSettings(this.optset);
                DialogResult res = frm.ShowDialog(this);
                sm.AppSettingsObject = frm.Settings;
                sm.WriteConfig();
                sm.ReadConfig();
                this.optset = (LocalAppSettings)sm.AppSettingsObject;
                frm.Dispose();
                this.BringToFront();
                this.txtUsername.Text = optset.Username;
                this.txtPassword.Text = optset.Password;
                this.lblExtension.Text = optset.PhoneExt;

                this.UpdateOutboundContextes();

                this.localizator.Culture = this.optset.Language;
                this.localizator.Localize(this);
                UpdateTooltips();
                this.FormSetFont();

                if (this.noOpTimer != null)
                {
                    this.noOpTimer.Interval = this.optset.SocketTimeout;
                }
                // this should refresh the socketmanager
                if (this.socketmanager != null)
                {
                    this.socketmanager.Host = this.optset.Host;
                    this.socketmanager.Port = this.optset.Port;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }