public GameResultItemViewModel(Game game, VpdbRelease release, VpdbVersion version, VpdbTableFile tableFile, ICommand closeCommand)
        {
            Game = game;
            Version = version;
            Release = release;
            TableFile = tableFile;

            SelectResult.Subscribe(_ =>
            {
                GameManager.LinkRelease(Game, release, tableFile.Reference.Id);
                MessageManager.LogReleaseLinked(game, release, tableFile.Reference.Id);

                closeCommand.Execute(null);
            });
        }
示例#2
0
 public Message LogReleaseDownloaded(VpdbRelease release, VpdbVersion version, VpdbFile file, double bytesPerSecond)
 {
     var msg = new Message(MessageType.ReleaseDownloaded, MessageLevel.Info, new Dictionary<string, string> {
         { DataRelease, release.Id },
         { DataReleaseName, release.Name },
         { DataVersion, version.Name },
         { DataFile, file.Id },
         { DataSubject, release.Game.DisplayName },
         { DownloadSpeed, $"{bytesPerSecond.Bytes().ToString("#.0")}/s" },
     });
     return Log(msg);
 }