/// <summary> /// Redo操作が可能か調べます。 /// </summary> private static void CanExecuteRedo(object sender, CanExecuteRelayEventArgs e) { var element = e.Parameter as GLShogiElement; if (element == null) { throw new ArgumentNullException("element"); } if (element.Board == null) { throw new InvalidOperationException( "element.Boardがnullです。"); } e.CanExecute = element.Board.CanRedo; }
/// <summary> /// コマンドの実行可能状態を調べます。 /// </summary> public bool CanExecute() { if (this.canExecute == null) { return true; } var e = new CanExecuteRelayEventArgs(this); this.canExecute(this, e); return e.CanExecute; }