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