Ejemplo n.º 1
0
        private static FileNode CreateFileNode(ArcFile arcFile, ArcFileNode arcNode, Action <string, bool> taskStart, Action <string> taskEnd)
        {
            // Lazy initialize the shared file list for performance reasons.
            List <string> getSharedFiles() => arcFile.GetSharedFilePaths(arcNode, ApplicationSettings.Instance.ArcRegion);

            // TODO: Avoid caching this information since it may change when changing regions.
            var fileNode = new FileNode(arcNode.FileName, arcNode.Path, arcNode.Extension,
                                        arcNode.IsShared, arcNode.IsRegional, arcNode.Offset, arcNode.CompSize, arcNode.DecompSize, arcNode.IsCompressed,
                                        getSharedFiles);

            fileNode.FileExtracting += (s, e) => ExtractFileAsync(arcFile, arcNode, taskStart, taskEnd);

            return(fileNode);
        }