private void ButtonEditProcessClick(object sender, EventArgs e) { var i = _mainForm.listBoxMonitoredApplications.SelectedIndex; var applicationHandlerConfig = _configuration.ApplicationHandlers[i]; var editForm = new EditForm(); var editFormVm = new EditFormVm(editForm, applicationHandlerConfig, _configuration); editForm.ShowDialog(_mainForm); _serializer.Serialize(_configuration); SetForm(applicationHandlerConfig); _mainForm.listBoxMonitoredApplications.Items[i] = _selectedItem.ApplicationName; }
private void ButtonAddProcessClick(object sender, EventArgs e) { var applicationHandlerConfig = new ApplicationHandlerConfig(); _configuration.ApplicationHandlers.Add(applicationHandlerConfig); var editForm = new EditForm(); var editFormVm = new EditFormVm(editForm, applicationHandlerConfig, _configuration); editForm.ShowDialog(_mainForm); _serializer.Serialize(_configuration); _mainForm.listBoxMonitoredApplications.Items.Add(applicationHandlerConfig.ApplicationName); SelectMenuItemInList(_mainForm.listBoxMonitoredApplications.Items.Count - 1); SetForm(applicationHandlerConfig); }