Ejemplo n.º 1
0
        private void LoadSettings()
        {
            if (System.IO.File.Exists(SettingsFilename))
            {
                Document doc = new Document();

                doc.LoadFile(SettingsFilename);
                Settings.Login login = doc.RootElement.SelectSingleElement(typeof(Settings.Login)) as Settings.Login;

                txtJid.Text       = login.Jid.ToString();
                txtPassword.Text  = login.Password;
                txtResource.Text  = login.Resource;
                numPriority.Value = login.Priority;
                chkSSL.Checked    = login.Ssl;
            }
        }
Ejemplo n.º 2
0
        private void SaveSettings()
        {
            Document doc = new Document();

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

            Settings.Login login = new Settings.Login();

            login.Jid      = new Jid(txtJid.Text);
            login.Password = txtPassword.Text;
            login.Resource = txtResource.Text;
            login.Priority = (int)numPriority.Value;
            login.Port     = int.Parse(txtPort.Text);
            login.Ssl      = chkSSL.Checked;

            doc.ChildNodes.Add(settings);
            settings.Login = login;

            doc.Save(SettingsFilename);
        }
Ejemplo n.º 3
0
        private void SaveSettings()
        {
            Document doc = new Document();

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

            Settings.Login login = new Settings.Login();

            login.Jid = new Jid(txtJid.Text);
            login.Password  = txtPassword.Text;
            login.Resource  = txtResource.Text;
            login.Priority  = (int) numPriority.Value;
            login.Port      = int.Parse(txtPort.Text);
            login.Ssl       = chkSSL.Checked;

            doc.ChildNodes.Add(settings);
            settings.Login = login;

            doc.Save(SettingsFilename);
        }
Ejemplo n.º 4
0
        private void InitSettings()
        {
            _settings = Util.LoadSettings();
            if (_settings.Login == null)
                _settings.Login = new Login();

            _login = _settings.Login;

            if (_login != null)
            {
                if (!string.IsNullOrEmpty(_login.User))
                    txtUsername.Text = _login.User;

                if (!string.IsNullOrEmpty(_login.Server))
                    txtXmppServer.Text = _login.Server;

                if (!string.IsNullOrEmpty(_login.Password))
                    txtPassword.Text = _login.Password;
            }
        }