示例#1
0
        private void LogonForm_Load(object sender, EventArgs e)
        {
            try
            {
                Properties.Settings settings = new ePlus.Properties.Settings();
                txtPassword.Text       = settings.Password.Trim();
                cbLoginName.Text       = settings.LastLogin.Trim();
                cbSavePassword.Checked = cbLoginName.Text != "" && txtPassword.Text != "";

                init_cb();
            }
            catch
            {
            }
        }
示例#2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (m_ServerInfo != null)
            {
                string[] ipAndPort = txtAddress.Text.Split(':');
                m_ServerInfo.Edit();

                m_ServerInfo.Name    = txtName.Text;
                m_ServerInfo.Address = ipAndPort[0];
                Properties.Settings settings = new ePlus.Properties.Settings();
                m_ServerInfo.Port               = ipAndPort.Length > 1 && ipAndPort[1] != "" ? Microsoft.VisualBasic.Information.IsNumeric(ipAndPort[1]) ? int.Parse(ipAndPort[1]) : settings.DefaultPort : settings.DefaultPort;
                m_ServerInfo.Description        = txtDescript.Text;
                m_ServerInfo.AuthenticationType = rbByPassword.Checked;
                m_ServerInfo.IsDefault          = cbDefault.Checked;
                m_ServerInfo.UserName           = m_ServerInfo.AuthenticationType ? txtUserName.Text : "";
                m_ServerInfo.Password           = cbSaveUserPassword.Checked ? txtPassword.Text : "";

                m_ServerInfo.Save();
                Close();
            }
        }
示例#3
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            Properties.Settings settings = new ePlus.Properties.Settings();

            settings.NoticeBackColor = lblNoticeBackColor.BackColor;
            settings.NoticeForeColor = lblNoticeForeColor.BackColor;
            settings.NoticeFont      = SetFontName(lblNoticeFontSize.Text);

            settings.EditorBackColor = lblWorkAreaBackColor.BackColor;
            settings.EditorForeColor = lblWorkAreaForeColor.BackColor;
            settings.EditorFont      = SetFontName(lblWorkAreaFontSize.Text);

            settings.Save();

            XMLConfig.XMLSettings xml = XMLConfig.Operation.GetSettingsCTI();

            if (rbEGSwitch.Checked)
            {
                xml.CtiType = XMLConfig.CtiTypeEnum.EGSwitch;
            }
            else if (rbEGPlug.Checked)
            {
                xml.CtiType = XMLConfig.CtiTypeEnum.EGPlug;
            }
            else if (rbUSB.Checked)
            {
                xml.CtiType = XMLConfig.CtiTypeEnum.EGUSB;
            }
            else if (rbMMPBX.Checked)
            {
                xml.CtiType = XMLConfig.CtiTypeEnum.EGMMPBX;
            }

            xml.CtiUdpPort = Convert.ToInt32(nudUdpPort.Value);
            xml.B2CURL     = txtB2CURL.Text.Trim();
            XMLConfig.Operation.SaveSettingsCTI(xml);

            Close();
        }
示例#4
0
        public OptionForm()
        {
            InitializeComponent();

            Properties.Settings settings = new ePlus.Properties.Settings();

            lblNoticeBackColor.BackColor = settings.NoticeBackColor;
            lblNoticeForeColor.BackColor = settings.NoticeForeColor;
            lblNoticeFontSize.Text       = GetFontName(settings.NoticeFont);

            lblWorkAreaBackColor.BackColor = settings.EditorBackColor;
            lblWorkAreaForeColor.BackColor = settings.EditorForeColor;
            lblWorkAreaFontSize.Text       = GetFontName(settings.EditorFont);

            XMLConfig.XMLSettings xml = XMLConfig.Operation.GetSettingsCTI();
            nudUdpPort.Value = xml.CtiUdpPort;
            txtB2CURL.Text   = xml.B2CURL;

            switch (xml.CtiType)
            {
            case XMLConfig.CtiTypeEnum.EGPlug:
                this.rbEGPlug.Checked = true;
                break;

            case XMLConfig.CtiTypeEnum.EGSwitch:
                this.rbEGSwitch.Checked = true;
                break;

            case XMLConfig.CtiTypeEnum.EGUSB:
                this.rbUSB.Checked = true;
                break;

            case XMLConfig.CtiTypeEnum.EGMMPBX:
                this.rbMMPBX.Checked = true;
                break;
            }
        }
示例#5
0
        void init_cb()
        {
            try
            {
                Properties.Settings settings = new ePlus.Properties.Settings();
                string[]            users    = settings.UserInfo.Split('|');

                for (int i = 0; i < users.Length; i++)
                {
                    if (users[i] == "")
                    {
                        continue;
                    }
                    if (users[i].Split(',').Length > 1)
                    {
                        ht.Add(users[i].Split(',')[0], users[i].Split(',')[1]);
                    }
                    else
                    {
                        ht.Add(users[i].Split(',')[0], "");
                    }
                }
                cbLoginName.Items.Clear();
                for (int i = 0; i < users.Length; i++)
                {
                    cbLoginName.Items.Add(users[i].Split(',')[0].Trim());
                }
            }
            catch//过渡期代码
            {
                try
                {
                    cbLoginName.Items.Clear();
                    Properties.Settings settings = new ePlus.Properties.Settings();
                    string[]            users    = settings.UserInfo.Split('\n');

                    for (int i = 0; i < users.Length; i++)
                    {
                        if (users[i] == "")
                        {
                            continue;
                        }
                        if (users[i].Split('\r').Length > 1)
                        {
                            ht.Add(users[i].Split('\r')[0], users[i].Split('\r')[1]);
                        }
                        else
                        {
                            ht.Add(users[i].Split('\r')[0], "");
                        }
                    }
                    cbLoginName.Items.Clear();
                    for (int i = 0; i < users.Length; i++)
                    {
                        cbLoginName.Items.Add(users[i].Split('\r')[0].Trim());
                    }
                }
                catch
                { }
            }
        }