private void AddPlayHandler(PlayStack playStack) { playStack.MouseDown += (sender, e) => { SetupMove(playStack.Stack); }; playStack.MouseUp += (sender, e) => { SetupMove(playStack.Stack); }; playStack.MouseDoubleClick += (sender, e) => { var top = playStack.Stack.Top; if (top != null) { var dest = Field.FinishStacks.FirstOrDefault(s => s.CanAccept(playStack.Stack.Top)); if (dest != null) { top.Move(dest); } } }; }
private void AddPlayHandler(PlayStack playStack) { playStack.MouseDown += (sender, e) => { SetupMove(playStack.Stack); }; playStack.MouseUp += (sender, e) => { SetupMove(playStack.Stack); }; playStack.MouseDoubleClick += (sender, e) => { var top = playStack.Stack.Top; if (top != null) { var dest = Field.FinishStacks.FirstOrDefault(s => s.CanAccept(playStack.Stack.Top)); if (dest != null) top.Move(dest); } }; }