public CreateGifViewModel(IGifEncoder gifEncoder, IWormsRunner wormsRunner, string replay)
 {
     _gifEncoder      = gifEncoder;
     _wormsRunner     = wormsRunner;
     _replay          = replay;
     _frames          = new string[0];
     CurrentOperation = new ObservableOperation <string>(Task.FromResult(string.Empty), string.Empty);
 }
        public void CreateGif()
        {
            var fileName = SaveFileAs(_replay, ".gif", "Animated GIF |*.gif");

            if (fileName != null)
            {
                CurrentOperation = new ObservableOperation <string>(CreateGifTask(fileName), string.Empty);
                OnPropertyChanged(nameof(CurrentOperation));
            }
        }
Exemple #3
0
 public SelectTurnViewModel(IWormsRunner wormsRunner, string replay)
 {
     _wormsRunner   = wormsRunner;
     TurnsOperation = new ObservableOperation <IReadOnlyList <TurnViewModel> >(GetTurnsForReplay(replay), new TurnViewModel[0]);
 }
 public void ExportFrames()
 {
     CurrentOperation = new ObservableOperation <string>(ExportFramesTask(), string.Empty);
     OnPropertyChanged(nameof(CurrentOperation));
 }