Ejemplo n.º 1
0
        public bool GetFileInfo(string virtualPath, out ArchiveManager.FileInfo fileInfo)
        {
            bool result;

            lock (VirtualFileSystem.syncVFS)
            {
                string key = VirtualFileSystem.NormalizePath(virtualPath).ToLower();
                if (!this.T.TryGetValue(key, out fileInfo))
                {
                    fileInfo = default(ArchiveManager.FileInfo);
                    result   = false;
                }
                else
                {
                    result = true;
                }
            }
            return(result);
        }
Ejemplo n.º 2
0
        private bool c()
        {
            this.t = new ArchiveManager.ClassA(null, true);
            List <ArchiveManager.ClassB> list = this.C();

            foreach (ArchiveManager.ClassB current in list)
            {
                Archive archive = current.Factory.OnLoadArchive(current.SourceRealFileName);
                if (archive == null)
                {
                    return(false);
                }
                string key = VirtualFileSystem.NormalizePath(current.SourceRealFileName).ToLower();
                this.s.Add(key, archive);
                string   virtualPathByReal = VirtualFileSystem.GetVirtualPathByReal(Path.GetDirectoryName(archive.FileName));
                string[] array;
                Archive.GetListFileInfo[] array2;
                archive.OnGetDirectoryAndFileList(out array, out array2);
                string[] array3 = array;
                for (int i = 0; i < array3.Length; i++)
                {
                    string text = array3[i];
                    string path = text.Trim(new char[]
                    {
                        '\\',
                        '/'
                    });
                    string text2 = Path.Combine(virtualPathByReal, path);
                    this.A(text2, true);
                }
                Archive.GetListFileInfo[] array4 = array2;
                for (int j = 0; j < array4.Length; j++)
                {
                    Archive.GetListFileInfo getListFileInfo = array4[j];
                    string text3         = VirtualFileSystem.NormalizePath(getListFileInfo.FileName);
                    string directoryName = Path.GetDirectoryName(text3);
                    string path2         = directoryName.Trim(new char[]
                    {
                        '\\',
                        '/'
                    });
                    string text4 = Path.Combine(virtualPathByReal, path2);
                    this.A(text4, true);
                    string text5            = Path.Combine(virtualPathByReal, text3);
                    ArchiveManager.ClassA a = this.A(Path.GetDirectoryName(text5), false);
                    if (a.@as == null)
                    {
                        a.@as = new List <string>();
                    }
                    [email protected](Path.GetFileName(text5));
                    string key2 = text5.ToLower();
                    ArchiveManager.FileInfo fileInfo;
                    if (this.T.TryGetValue(key2, out fileInfo))
                    {
                        this.T.Remove(key2);
                    }
                    ArchiveManager.FileInfo value = new ArchiveManager.FileInfo(text5, archive, getListFileInfo.FileName, getListFileInfo.Length);
                    this.T.Add(key2, value);
                }
            }
            return(true);
        }