Ejemplo n.º 1
0
        private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var window = new OptionsWindow();

            if (Server != null)
            {
                SetText(window, "tbModSicAddr", Server.Address);
                SetText(window, "tbModSicUser", Server.Username);
                SetText(window, "tbModSicPass", Server.Password);
                SetText(window, "tbModSicPort", Server.Port);
            }

            window.Icon = this.Icon;

            if (window.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            {
                Server.Address  = GetText(window, "tbModSicAddr");
                Server.Username = GetText(window, "tbModSicUser");
                Server.Password = GetText(window, "tbModSicPass");
                Server.Port     = GetText(window, "tbModSicPort");
            }
        }
Ejemplo n.º 2
0
        private void SetText(OptionsWindow window, string name, string text)
        {
            var control = window.Controls.Find(name, true).First() as TextBox;

            control.Text = text;
        }
Ejemplo n.º 3
0
        private string GetText(OptionsWindow window, string name)
        {
            var control = window.Controls.Find(name, true).First() as TextBox;

            return(control.Text);
        }
Ejemplo n.º 4
0
        private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var window = new OptionsWindow();
            if (Server != null)
            {
                SetText(window, "tbModSicAddr", Server.Address);
                SetText(window, "tbModSicUser", Server.Username);
                SetText(window, "tbModSicPass", Server.Password);
                SetText(window, "tbModSicPort", Server.Port);
            }

            window.Icon = this.Icon;

            if (window.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            {
                Server.Address = GetText(window, "tbModSicAddr");
                Server.Username = GetText(window, "tbModSicUser");
                Server.Password = GetText(window, "tbModSicPass");
                Server.Port = GetText(window, "tbModSicPort");
            }
        }
Ejemplo n.º 5
0
 private void SetText(OptionsWindow window, string name, string text)
 {
     var control = window.Controls.Find(name, true).First() as TextBox;
     control.Text = text;
 }
Ejemplo n.º 6
0
 private string GetText(OptionsWindow window, string name)
 {
     var control = window.Controls.Find(name, true).First() as TextBox;
     return control.Text;
 }