use CommandEventArgs.Command instead of assuming sender is a Command (it is not always, and should not ever be)

This commit is contained in:
Michael Becker 2021-05-21 19:53:14 -04:00
parent aadca49721
commit 4f8c4c2e89
No known key found for this signature in database
GPG Key ID: 98C333A81F18C22C
2 changed files with 5 additions and 5 deletions

View File

@ -493,7 +493,7 @@ namespace UniversalEditor.UserInterface
#region View
Application.Instance.AttachCommandEventHandler("ViewFullScreen", delegate(object sender, EventArgs e)
{
Command cmd = (sender as Command);
Command cmd = (e as CommandEventArgs).Command;
LastWindow.FullScreen = !LastWindow.FullScreen;
cmd.Checked = LastWindow.FullScreen;
});
@ -761,7 +761,7 @@ namespace UniversalEditor.UserInterface
void cmdViewToolbarsToolbar_Executed(object sender, EventArgs e)
{
Command cmd = (sender as Command);
Command cmd = (e as CommandEventArgs).Command;
}

View File

@ -226,7 +226,7 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.Views.PianoRoll
private void ContextMenu_NoteFixedLength_Click(object sender, EventArgs e)
{
Command cmd = (sender as Command);
Command cmd = (e as CommandEventArgs).Command;
string sValue = cmd.ID.Substring("PianoRollEditor_ContextMenu_NoteFixedLength_".Length);
int iValue = -1;
@ -253,7 +253,7 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.Views.PianoRoll
}
private void ContextMenu_Quantize_Click(object sender, EventArgs e)
{
Command cmd = (sender as Command);
Command cmd = (e as CommandEventArgs).Command;
string sValue = cmd.ID.Substring("PianoRollEditor_ContextMenu_Quantize_".Length);
int iValue = 4; //-1;
@ -282,7 +282,7 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.Views.PianoRoll
}
private void ContextMenu_NoteLength_Click(object sender, EventArgs e)
{
Command cmd = (sender as Command);
Command cmd = (e as CommandEventArgs).Command;
string sValue = cmd.ID.Substring("PianoRollEditor_ContextMenu_NoteLength_".Length);
int iValue = 4; //-1;