コード例 #1
0
ファイル: LauncherForm.cs プロジェクト: tony1223/Launcher
        }//end pctLinLogo_Click

        private void LauncherForm_KeyDown(object sender, KeyEventArgs e)
        {
            if (!e.Control || !e.Shift || e.KeyCode != Keys.A)
            {
                return;
            }

            var addServerForm = new AddServerForm();

            if (addServerForm.ShowDialog() == DialogResult.OK)
            {
                if (this._config.Servers.ContainsKey(addServerForm.txtName.Text))
                {
                    MessageBox.Show("A server with that name has already been added.");
                    return;
                }

                this._config.Servers.Add(addServerForm.txtName.Text, new Server
                {
                    IpOrDns = addServerForm.txtIpAddress.Text,
                    Port    = Convert.ToInt32(addServerForm.txtPort.Text)
                });

                this.cmbServer.Items.Add(addServerForm.txtName.Text);
                this.cmbServer.SelectedIndex = cmbServer.Items.Count - 1;
            } //end if
        }     //end LauncherForm_KeyDown
コード例 #2
0
        public Form1()
        {
            InitializeComponent();

            ApplicationStatus.activeServer = null;

            serverContainer = new ServerContainer(this);
            addServerForm   = new AddServerForm(this);
            editServerForm  = new EditServerForm(this);

            timer          = new Timer();
            timer.Interval = pingInterval * 1000;
            timer.Tick    += new EventHandler(timerTick);
            timer.Start();

            downloadMessageWatch = new Stopwatch();
            downloadMessageWatch.Start();

            serverList.View        = View.Details;
            serverList.MultiSelect = false;

            int columnWidth = 130;

            serverList.Columns.Add("Name", columnWidth, HorizontalAlignment.Left);
            serverList.Columns.Add("Website", columnWidth, HorizontalAlignment.Left);
            serverList.Columns.Add("Version", columnWidth, HorizontalAlignment.Left);
            serverList.Columns.Add("Status", columnWidth, HorizontalAlignment.Left);

            VersionChecker.checkForNewVersion();
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: Freddan962/WoWLauncher
        public Form1()
        {
            InitializeComponent();

            ApplicationStatus.activeServer = null;

            serverContainer = new ServerContainer(this);
            addServerForm = new AddServerForm(this);
            editServerForm = new EditServerForm(this);

            timer = new Timer();
            timer.Interval = pingInterval * 1000;
            timer.Tick += new EventHandler(timerTick);
            timer.Start();

            downloadMessageWatch = new Stopwatch();
            downloadMessageWatch.Start();

            serverList.View = View.Details;
            serverList.MultiSelect = false;

            int columnWidth = 130;
            serverList.Columns.Add("Name", columnWidth, HorizontalAlignment.Left);
            serverList.Columns.Add("Website", columnWidth, HorizontalAlignment.Left);
            serverList.Columns.Add("Version", columnWidth, HorizontalAlignment.Left);
            serverList.Columns.Add("Status", columnWidth, HorizontalAlignment.Left);

            VersionChecker.checkForNewVersion();
        }
コード例 #4
0
        public AddSimpleServerForm(Form1 form, AddServerForm addServerForm)
        {
            InitializeComponent();

            this.form          = form;
            this.addServerForm = addServerForm;

            directoryPath = string.Empty;
        }
コード例 #5
0
        private void addServerButton_Click(object sender, EventArgs e)
        {
            if (addServerForm == null)
            {
                addServerForm = new AddServerForm(this);
            }

            if (!addServerForm.Visible)
            {
                addServerForm.Show();
            }
        }
コード例 #6
0
        public AddCustomServerForm(Form1 form, AddServerForm addServerForm)
        {
            InitializeComponent();

            this.addServerForm = addServerForm;
            this.form          = form;

            directoryPath = string.Empty;

            versionComboItems.Add("1", "Vanilla");
            versionComboItems.Add("2", "The Burning Crusade");
            versionComboItems.Add("3", "Wrath of the Lich King");

            versionCombo.DataSource    = new BindingSource(versionComboItems, null);
            versionCombo.DisplayMember = "Value";
            versionCombo.ValueMember   = "Key";
        }
コード例 #7
0
        public AddCustomServerForm(Form1 form, AddServerForm addServerForm)
        {
            InitializeComponent();

            this.addServerForm = addServerForm;
            this.form = form;

            directoryPath = string.Empty;

            versionComboItems.Add("1", "Vanilla");
            versionComboItems.Add("2", "The Burning Crusade");
            versionComboItems.Add("3", "Wrath of the Lich King");

            versionCombo.DataSource = new BindingSource(versionComboItems, null);
            versionCombo.DisplayMember = "Value";
            versionCombo.ValueMember = "Key";
        }
コード例 #8
0
ファイル: Form1.cs プロジェクト: Freddan962/WoWLauncher
        private void addServerButton_Click(object sender, EventArgs e)
        {
            if (addServerForm == null)
                addServerForm = new AddServerForm(this);

            if (!addServerForm.Visible)
                addServerForm.Show();
        }