private void Item_OnRemove(WebListItem item) { item.Stop(); flowLayoutPanel1.Controls.Remove(item); _settingStorage.Remove(item.Setting); item.Dispose(); }
private void AddServer(Setting setting) { var item = new WebListItem(setting); item.Width = flowLayoutPanel1.Width - 25; item.OnRemove += Item_OnRemove; item.OnUpdate += Item_OnUpdate; flowLayoutPanel1.Controls.Add(item); }
private void Item_OnUpdate(WebListItem sender) { using (var dialog = new NewServerDialog(sender.Setting)) { if (dialog.ShowDialog() == DialogResult.OK) { var setting = new Setting { Name = dialog.ServerName, Path = dialog.Path, Port = dialog.Port }; if (_settingStorage.Update(setting)) { sender.UpdateSetting(setting); } } } }
// GET: Web public ActionResult Index() { var model = new WebListItem[0]; return(View(model)); }