public void CommandExecuting(ICommand command) { if (command is UndoCommand) { return; } CurrentUndoGroupId = DateTime.Now.Hour.ToString() + DateTime.Now.Minute + DateTime.Now.Second.ToString(); CurrentName = command.Title; UndoItems.Clear(); }
public UndoItem PopUndo() { var undoItem = UndoItems.LastOrDefault(); if (undoItem != null) { UndoItems.Remove(undoItem); } return(undoItem); }
public void InitPlayer(int sets, int legs, int startingScore, bool resetScores) { UnHighlight(); Sets = sets; LegsPerSet = legs; DartsToThrow = 0; CurrentDartCount = 0; LastDarts.Clear(); UndoItems.Clear(); if (resetScores) { TurnScores.Clear(); SetsWon = 0; LegsWon = 0; LegsPlayed = 0; CummulativeLegsWon = 0; } IsWinner = false; CurrentScore = startingScore; InterimScore = CurrentScore; WinMessage = string.Empty; LeaderMessage = string.Empty; UpdateScore(); TwentyImage = new BitmapImage(new Uri("ms-appx:///Assets/twenty.png", UriKind.Absolute)); NineteenImage = new BitmapImage(new Uri("ms-appx:///Assets/nineteen.png", UriKind.Absolute)); EighteenImage = new BitmapImage(new Uri("ms-appx:///Assets/eighteen.png", UriKind.Absolute)); SeventeenImage = new BitmapImage(new Uri("ms-appx:///Assets/seventeen.png", UriKind.Absolute)); SixteenImage = new BitmapImage(new Uri("ms-appx:///Assets/sixteen.png", UriKind.Absolute)); FifteenImage = new BitmapImage(new Uri("ms-appx:///Assets/fifteen.png", UriKind.Absolute)); BullImage = new BitmapImage(new Uri("ms-appx:///Assets/bull.png", UriKind.Absolute)); }
public void ClearUndo() { UndoItems.Clear(); }