private void addServerToListView(Model.ServerModel model) { var lvi = new ListViewItem(model.Url); lvi.Tag = model; lvServers.Items.Add(lvi); }
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(); }
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(); }