public override void Execute(object parameter) { try { HsCommandParams cp = parameter as HsCommandParams; if (cp != null) { if (cp.ActionKey == SysActionKeys.UserDo1) { allowCheck = false; this._checkIsUpgrade(); } } else { base.Execute(parameter); } } catch (Exception e) { this.ShowError(e.Message); } finally { allowCheck = true; } }
public static HsActionKey GetActionKey(this MenuItem item) { HsCommandParams cp = item.CommandParameter as HsCommandParams; return(cp?.ActionKey); }