diff --git a/KeeAgent/KeeAgentColumnProvider.cs b/KeeAgent/KeeAgentColumnProvider.cs index 14fb20b..e28de15 100644 --- a/KeeAgent/KeeAgentColumnProvider.cs +++ b/KeeAgent/KeeAgentColumnProvider.cs @@ -130,7 +130,7 @@ internal void Agent_KeyAddedOrRemoved(object sender, SshKeyEventArgs e) UpdateUI(); } - private void Agent_Locked(object aSender, Agent.LockEventArgs aEventArgs) + private void Agent_Locked(object sender, Agent.LockEventArgs e) { UpdateUI(); } diff --git a/KeeAgent/KeeAgentExt.cs b/KeeAgent/KeeAgentExt.cs index 114c845..54f9943 100644 --- a/KeeAgent/KeeAgentExt.cs +++ b/KeeAgent/KeeAgentExt.cs @@ -558,7 +558,7 @@ private void RemoveMenuItems() } } - private void manageKeeAgentMenuItem_Click(object aSource, EventArgs aEvent) + private void manageKeeAgentMenuItem_Click(object sender, EventArgs e) { ShowManageDialog(); } @@ -653,21 +653,19 @@ private void LoadOptions() /// Kudos to the luckyrat for figuring out how to to this in KeePassRPC /// (KeeFox) and open-sourcing the code so I could copy/learn from it. /// - private void WindowAddedHandler(object aSender, - GwmWindowEventArgs aEventArgs) + private void WindowAddedHandler(object sender, GwmWindowEventArgs e) { /* Add KeeAgent tab to PwEntryForm dialog */ - var pwEntryForm = aEventArgs.Form as PwEntryForm; + var pwEntryForm = e.Form as PwEntryForm; if (pwEntryForm != null) { var optionsPanel = new EntryPanel(this); - pwEntryForm.Shown += - delegate(object sender, EventArgs args) + pwEntryForm.Shown += (s, e2) => { pwEntryForm.AddTab(optionsPanel); }; var foundControls = pwEntryForm.Controls.Find("m_btnOK", true); var okButton = foundControls[0] as Button; - okButton.GotFocus += (sender, args) => + okButton.GotFocus += (s, e2) => { if (optionsPanel.CurrentSettings != optionsPanel.IntialSettings) { pwEntryForm.EntryBinaries.SetKeeAgentSettings(optionsPanel.CurrentSettings); @@ -678,10 +676,9 @@ private void WindowAddedHandler(object aSender, } /* Add KeeAgent tab to Database Settings dialog */ - var databaseSettingForm = aEventArgs.Form as DatabaseSettingsForm; + var databaseSettingForm = e.Form as DatabaseSettingsForm; if (databaseSettingForm != null) { - databaseSettingForm.Shown += - delegate(object sender, EventArgs args) + databaseSettingForm.Shown += (s, e2) => { var dbSettingsPanel = new DatabaseSettingsPanel(pluginHost.MainWindow.ActiveDatabase); @@ -690,10 +687,9 @@ private void WindowAddedHandler(object aSender, } /* Add KeeAgent tab to Options dialog */ - var optionsForm = aEventArgs.Form as OptionsForm; + var optionsForm = e.Form as OptionsForm; if (optionsForm != null) { - optionsForm.Shown += - delegate(object sender, EventArgs args) + optionsForm.Shown += (s, e2) => { var optionsPanel = new OptionsPanel(this); optionsForm.AddTab(optionsPanel); @@ -702,12 +698,11 @@ private void WindowAddedHandler(object aSender, } } - private void PwEntryForm_EntrySaving(object aSender, - CancellableOperationEventArgs aEventArgs) + private void PwEntryForm_EntrySaving(object sender, CancellableOperationEventArgs e) { /* Get reference to new settings */ - var entryForm = aSender as PwEntryForm; + var entryForm = sender as PwEntryForm; if (entryForm != null && (entryForm.DialogResult == DialogResult.OK || saveBeforeCloseQuestionMessageShown)) { var foundControls = entryForm.Controls.Find("EntryPanel", true); @@ -764,23 +759,21 @@ private void PwEntryForm_EntrySaving(object aSender, } } MessageService.ShowWarning(errorMessage); - aEventArgs.Cancel = true; + e.Cancel = true; } } } saveBeforeCloseQuestionMessageShown = false; } - private void PwEntryForm_FormClosing(object aSender, - FormClosingEventArgs aEventArgs) + private void PwEntryForm_FormClosing(object sender, FormClosingEventArgs e) { saveBeforeCloseQuestionMessageShown = false; } - private void OptionsForm_FormClosed(object aSender, - FormClosedEventArgs aEventArgs) + private void OptionsForm_FormClosed(object sender, FormClosedEventArgs e) { - var optionsForm = aSender as OptionsForm; + var optionsForm = sender as OptionsForm; if (optionsForm != null && optionsForm.DialogResult == DialogResult.OK) { SaveGlobalOptions(); } @@ -796,11 +789,11 @@ internal void Log(string aMessage) } } - private void PageantAgent_Locked(object aSender, Agent.LockEventArgs aEventArgs) + private void PageantAgent_Locked(object sender, Agent.LockEventArgs e) { if (Options.ShowBalloon) { string notifyText; - if (aEventArgs.IsLocked) { + if (e.IsLocked) { notifyText = Translatable.NotifyLocked; } else { notifyText = Translatable.NotifyUnlocked; @@ -825,8 +818,7 @@ private void PageantAgent_KeyRemoved(object sender, SshKeyEventArgs e) RemoveKey(e.Key); } - private void PageantAgent_MessageReceived(object aSender, - Agent.MessageReceivedEventArgs aEventArgs) + private void PageantAgent_MessageReceived(object sender, Agent.MessageReceivedEventArgs e) { var mainWindow = pluginHost.MainWindow; @@ -953,8 +945,7 @@ private void MainForm_FileClosing(object sender, FileClosingEventArgs e) } } - private void MainForm_FileClosed(object aSender, - FileClosedEventArgs aEventArgs) + private void MainForm_FileClosed(object sender, FileClosedEventArgs e) { try { foreach (var key in removeKeyList) { @@ -967,11 +958,10 @@ private void MainForm_FileClosed(object aSender, } } - private void MessageService_MessageShowing(object aSender, - MessageServiceEventArgs aEventArgs) + private void MessageService_MessageShowing(object sender, MessageServiceEventArgs e) { - if (aEventArgs.Title == PwDefs.ShortProductName && - aEventArgs.Text == KPRes.SaveBeforeCloseQuestion) { + if (e.Title == PwDefs.ShortProductName && + e.Text == KPRes.SaveBeforeCloseQuestion) { saveBeforeCloseQuestionMessageShown = true; } } diff --git a/KeeAgent/UI/DatabaseSettingsPanel.cs b/KeeAgent/UI/DatabaseSettingsPanel.cs index f64de5b..dbfe8f1 100644 --- a/KeeAgent/UI/DatabaseSettingsPanel.cs +++ b/KeeAgent/UI/DatabaseSettingsPanel.cs @@ -49,8 +49,7 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (ParentForm != null) { - ParentForm.FormClosing += - delegate(object aSender, FormClosingEventArgs aEventArgs) + ParentForm.FormClosing += (s, e2) => { if (ParentForm.DialogResult == DialogResult.OK) { var settings = mDatabaseSettingsBindingSource.DataSource as DatabaseSettings; diff --git a/KeeAgent/UI/GroupBoxEx.cs b/KeeAgent/UI/GroupBoxEx.cs index 1fa6323..1f59079 100644 --- a/KeeAgent/UI/GroupBoxEx.cs +++ b/KeeAgent/UI/GroupBoxEx.cs @@ -88,8 +88,7 @@ protected override void OnControlAdded(ControlEventArgs e) base.OnControlAdded(e); var radioButton = e.Control as RadioButton; if (radioButton != null) { - radioButton.CheckedChanged += - delegate(object aSender, EventArgs aEventArgs) + radioButton.CheckedChanged += (s, e2) => { if (radioButton.Checked) { SelectedRadioButton = radioButton.Name; diff --git a/KeeAgent/UI/KeyLocationPanel.cs b/KeeAgent/UI/KeyLocationPanel.cs index 11eb67a..357b538 100644 --- a/KeeAgent/UI/KeyLocationPanel.cs +++ b/KeeAgent/UI/KeyLocationPanel.cs @@ -72,27 +72,27 @@ public KeyLocationPanel() SetStyle(ControlStyles.SupportsTransparentBackColor, true); BackColor = Color.Transparent; - locationGroupBox.DataBindings["SelectedRadioButton"].Format += - delegate (object aSender, ConvertEventArgs aEventArgs) { - if (aEventArgs.DesiredType == typeof(string)) { - var type = aEventArgs.Value as EntrySettings.LocationType?; + locationGroupBox.DataBindings["SelectedRadioButton"].Format += (s, e) => + { + if (e.DesiredType == typeof(string)) { + var type = e.Value as EntrySettings.LocationType?; switch (type) { case EntrySettings.LocationType.Attachment: - aEventArgs.Value = attachmentRadioButton.Name; + e.Value = attachmentRadioButton.Name; break; case EntrySettings.LocationType.File: - aEventArgs.Value = fileRadioButton.Name; + e.Value = fileRadioButton.Name; break; default: - aEventArgs.Value = string.Empty; + e.Value = string.Empty; break; } } else { Debug.Fail("unexpected"); } }; - locationGroupBox.DataBindings["SelectedRadioButton"].Parse += - delegate (object sender, ConvertEventArgs e) { + locationGroupBox.DataBindings["SelectedRadioButton"].Parse += (s, e) => + { if (e.DesiredType == typeof(EntrySettings.LocationType?) && e.Value is string) { var valueString = e.Value as string; @@ -109,14 +109,10 @@ public KeyLocationPanel() }; // workaround for BindingSource.BindingComplete event not working in Mono if (Type.GetType("Mono.Runtime") != null) { - locationGroupBox.SelectedRadioButtonChanged += - (sender, e) => FireKeyLocationChanged(); - attachmentComboBox.SelectionChangeCommitted += - (sender, e) => FireKeyLocationChanged(); - saveKeyToTempFileCheckBox.CheckedChanged += - (sender, e) => FireKeyLocationChanged(); - fileNameTextBox.TextChanged += - (sender, e) => FireKeyLocationChanged(); + locationGroupBox.SelectedRadioButtonChanged += (s, e) => FireKeyLocationChanged(); + attachmentComboBox.SelectionChangeCommitted += (s, e) => FireKeyLocationChanged(); + saveKeyToTempFileCheckBox.CheckedChanged += (s, e) => FireKeyLocationChanged(); + fileNameTextBox.TextChanged += (s, e) => FireKeyLocationChanged(); } } diff --git a/SshAgentLib b/SshAgentLib index deb8928..5f314d1 160000 --- a/SshAgentLib +++ b/SshAgentLib @@ -1 +1 @@ -Subproject commit deb8928edb19f9376c846cd7737c22054a8dbea3 +Subproject commit 5f314d179ba9cb52cb9ba1b2b1e38b96d57931f5