예제 #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));
                }
            }
        }
예제 #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);
     }
 }
예제 #3
0
 public EntityZipFile(ZipEntry newEntry, EntityZip newZipParent)
 {
     entry     = newEntry;
     ZipParent = newZipParent;
 }
예제 #4
0
 public void Visit(EntityZip info)
 {
     return;
 }
예제 #5
0
 public void Visit(EntityZip info)
 {
     throw new NotImplementedException();
 }