void ExecuteOnAttack(IonianTone?tone) { if (AttackCommand?.CanExecute(tone) ?? false) { AttackCommand.Execute(tone); } }
private void AttackKey() { if (AttackCommand?.CanExecute(this) ?? false) { AttackCommand.Execute(this); attacked = true; Rectangle.Fill = Sharp ? SharpAttackKeyFill : AttackKeyFill; } }
void ExecuteOnAttack(PianoKey view) { var tone = new IonianTone() { Scale = view.Scale, Sharp = view.Sharp, Octave = view.Scale == IonianScale.A || view.Scale == IonianScale.B ? Octave + 1 : Octave, }; if (AttackCommand?.CanExecute(tone) ?? false) { AttackCommand.Execute(tone); } }