コード例 #1
0
        public async Task <IAbsoluteFilePath> WriteParFile(WriteParFileInfo info)
        {
            var filePath = GetFilePath(info);

            this.Logger().Info("Writing par file at: {0}, with:\n{1}", filePath, info.Content);
            await _writer.WriteFileAsync(filePath.ToString(), info.Content, Encoding.UTF8).ConfigureAwait(false);

            // Encoding.Default :S
            return(filePath);
        }
コード例 #2
0
        static string GetFileName(WriteParFileInfo info)
        {
            var additionalIdentifier = info.AdditionalIdentifier == null ? null : "_" + info.AdditionalIdentifier;

            return("par" + additionalIdentifier + ".txt");
        }
コード例 #3
0
 IAbsoluteFilePath GetFilePath(WriteParFileInfo info)
 => _parPath.GetChildDirectoryWithName(new ShortGuid(info.GameId).ToString())
 .GetChildFileWithName(GetFileName(info));