Exemple #1
0
        public EntityZipDirect(ZipEntry newEntry, List <ZipEntry> newFiles, IEntity newParent, EntityZip newZipParent)
        {
            items     = new List <IEntity>();
            parent    = newParent;
            entry     = newEntry;
            ZipParent = newZipParent;

            for (int i = 0; i < newFiles.Count; i++)
            {
                if (newFiles[i].IsDirectory)
                {
                    int             j = 1;
                    List <ZipEntry> directoryElements = new List <ZipEntry>();
                    while (i + j < newFiles.Count && newFiles[i + j].FileName.StartsWith(newFiles[i].FileName))
                    {
                        directoryElements.Add(newFiles[i + j++]);
                    }

                    items.Add(new EntityZipDirect(newFiles[i], directoryElements, this, ZipParent));
                    i = i + j - 1;
                }
                else
                {
                    items.Add(new EntityZipFile(newFiles[i], ZipParent));
                }
            }
        }
Exemple #2
0
 public void UpdateDirectory()
 {
     if (curDirectory == null)
     {
         return;
     }
     if (curDirectory.GetType() == EntityType.ZIP)
     {
         curDirectory = new EntityZip(curDirectory.GetFullName());
     }
     else if (curDirectory.GetType() == EntityType.ZIPDIRECTORY)
     {
         string    path   = curDirectory.GetFullName();
         EntityZip parent = ((EntityZipDirect)curDirectory).ZipParent;
         parent       = new EntityZip(parent.GetFullName());
         curDirectory = parent.GetItemByPath(path);
     }
 }
Exemple #3
0
 public EntityZipFile(ZipEntry newEntry, EntityZip newZipParent)
 {
     entry     = newEntry;
     ZipParent = newZipParent;
 }
Exemple #4
0
 public void Visit(EntityZip info)
 {
     return;
 }
Exemple #5
0
 public void Visit(EntityZip info)
 {
     throw new NotImplementedException();
 }