public void UnuseFileSystem(FileSystemReference reference) { // When root filesystem was used. if (reference.Usage.ArchiveFile == null) { return; } FileSystemUsage usage; if (!_usedArchives.TryGetValue(reference.Usage.ArchiveFile, out usage)) { throw new ArgumentException("The specified reference is not valid."); } if (!usage.References.Remove(reference)) { throw new ArgumentException("The specified reference does not exist."); } if (usage.References.Count == 0) { _usedArchives.Remove(usage.ArchiveFile); usage.FileSystem.Dispose(); } }
private FileSystemReference CreateReference(File file) { var usage = GetArchiveFs(file); var reference = new FileSystemReference(usage); usage.References.Add(reference); return(reference); }
public void UnuseFileSystem(FileSystemReference reference) { // When root filesystem was used. if (reference.Usage.ArchiveFile == null) return; FileSystemUsage usage; if (!_usedArchives.TryGetValue(reference.Usage.ArchiveFile, out usage)) throw new ArgumentException("The specified reference is not valid."); if (!usage.References.Remove(reference)) throw new ArgumentException("The specified reference does not exist."); if (usage.References.Count == 0) { _usedArchives.Remove(usage.ArchiveFile); usage.FileSystem.Dispose(); } }
public SafeReferenceStream(Stream stream, FileSystemReference reference) { _stream = stream; _reference = reference; }
private FileSystemReference CreateReference(File file) { var usage = GetArchiveFs(file); var reference = new FileSystemReference(usage); usage.References.Add(reference); return reference; }
public SafeReferenceStream(Stream stream, FileSystemReference reference) { _stream = stream; _reference = reference; }
static bool ShouldInclude(FileSystemReference Reference, string[] InvariantExcludedSuffixes) { // Ignore Mac resource fork files on non-HFS partitions if (Path.GetFileName(Reference.CanonicalName).StartsWith("._")) { return false; } foreach (string InvariantExcludedSuffix in InvariantExcludedSuffixes) { if (Reference.CanonicalName.EndsWith(InvariantExcludedSuffix)) { return false; } } return true; }
/// <summary> /// Takes the given path and tries to rebase it relative to the project. /// </summary> public string NormalizeProjectPath(FileSystemReference InputPath) { // Try to make it relative to the solution directory. if (InputPath.IsUnderDirectory(ProjectFileGenerator.MasterProjectPath)) { return InputPath.MakeRelativeTo(ProjectFileGenerator.IntermediateProjectFilesPath); } else { return InputPath.FullName; } }