コード例 #1
0
        private void addServerToListView(Model.ServerModel model)
        {
            var lvi = new ListViewItem(model.Url);

            lvi.Tag = model;
            lvServers.Items.Add(lvi);
        }
コード例 #2
0
        private void lvServers_SelectedIndexChanged(object sender, EventArgs e)
        {
            gbPortals.Visible = btnEditServer.Enabled = btnTest.Enabled = btnDeleteServer.Enabled = lvServers.SelectedItems.Count > 0;
            if (lvServers.SelectedItems.Count <= 0)
            {
                return;
            }
            var lvi = lvServers.SelectedItems[0];

            currentServer = (Model.ServerModel)lvi.Tag;
            refreshPortalListView();
        }
コード例 #3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (Model == null)
            {
                Model = new Model.ServerModel();
            }

            Model.Url            = txtUrl.Text.Trim();
            Model.Password       = txtPassword.Text.Trim();
            Model.EnableCompress = cbEnableCompress.Checked;
            Model.EnableEncrypt  = cbEnableEncrypt.Checked;

            this.DialogResult = DialogResult.OK;
            this.Close();
        }