private void removeHandlerButton_Click(object sender, EventArgs e) { foreach (DataGridViewRow r in handlersDataGridView.SelectedRows) { handlersDataGridView.Rows.RemoveAt(r.Index); NajmConfigs.RemoveHandler((Guid)r.Cells[0].Value); } }
private void handlersDataGridView_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 4 && e.RowIndex > 0) // enabled { Guid id = (Guid)handlersDataGridView.Rows[e.RowIndex].Cells[0].Value; bool enabled = (bool)handlersDataGridView.Rows[e.RowIndex].Cells[4].Value; NajmConfigs.EnableHandler(id, enabled); } }
private void SaveNajmConfigs() { try { NajmConfigs.Save(); } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }
private void addHandlerButton_Click(object sender, EventArgs e) { AddHandlerForm ahf = new AddHandlerForm(); ahf.ShowDialog(); if (ahf.HandlerInfo != null) { string location = string.IsNullOrEmpty(ahf.HandlerInfo.Location) ? "<Default>" : ahf.HandlerInfo.Location; object[] columns = new object[] { ahf.HandlerInfo.Id, ahf.HandlerInfo.Assembly, location, ahf.HandlerInfo.Param, ahf.HandlerInfo.Enabled }; handlersDataGridView.Rows.Add(columns); NajmConfigs.AddHandler(ahf.HandlerInfo); } }
private void InvokeSettingsDialog() { Settings sd = new Settings(); if (sd.ShowDialog() == DialogResult.OK) { if (NajmConfigs.IsDirty) { _handlersManager.LoadHandlersOnly(NajmConfigs.Handlers); SaveNajmConfigs(); } } else { NajmConfigs.DiscardChanges(); } }
private void MainAppForm_Load(object sender, EventArgs e) { _curTreeNode = null; // TODO: i pass this here now to do the handlers related stuff outside this file keeping it small // perhaps a better way is to create another partial class that handles HandlersManager event // and do these tasks in it...later! // Also it seems that we need a Handler class to wrap the even growing handler things: // like: image, button, events,... _handlersManager = new HandlersManager(this); // create imagelist in the tab control to be used when tab pages are added for handlers handlersTabControl.ImageList = new ImageList(); #if DEBUG Left += 1920 + 200; #endif NajmConfigs.Load(); _handlersManager.LoadHandlers(NajmConfigs.Handlers); }
private void removeAllHandlersButton_Click(object sender, EventArgs e) { handlersDataGridView.Rows.Clear(); NajmConfigs.RemoveAll(); }