internal FileChangeVersionOne CreateFileChangeVersionOne(ArtifactChange v2FileChange) { FileChangeVersionOne fileChange = null; if (v2FileChange != null) { string encodingName = GetFileEncodingName(v2FileChange.ArtifactLocation?.Uri); Encoding encoding = GetFileEncoding(encodingName); try { fileChange = new FileChangeVersionOne { Replacements = v2FileChange.Replacements?.Select(r => CreateReplacementVersionOne(r, encoding)).ToList(), Uri = v2FileChange.ArtifactLocation?.Uri, UriBaseId = v2FileChange.ArtifactLocation?.UriBaseId }; } catch (UnknownEncodingException ex) { // Set the unknown encoding name so the caller can provide useful reporting ex.EncodingName = encodingName; throw ex; } } return(fileChange); }
internal ArtifactChange CreateFileChange(FileChangeVersionOne v1FileChange) { ArtifactChange fileChange = null; if (v1FileChange != null) { fileChange = new ArtifactChange { ArtifactLocation = CreateFileLocation(v1FileChange), Replacements = v1FileChange.Replacements?.Select(CreateReplacement).ToList() }; } return(fileChange); }
internal ArtifactLocation CreateFileLocation(FileChangeVersionOne v1FileChange) { return(CreateFileLocation(v1FileChange?.Uri, v1FileChange?.UriBaseId)); }