/// <summary> /// Delegate that's called for every file in cabinet. /// </summary> /// <param name="fdint">NOTIFICATIONTYPE</param> /// <param name="pfdin">NOTIFICATION</param> /// <returns>System.Int32</returns> internal Handle Notify(CabInterop.NOTIFICATIONTYPE fdint, CabInterop.NOTIFICATION pfdin) { // This is FDI's way of notifying us of how many files total are in the cab, accurate even // if the files are split into multiple folders - use it to allocate the precise size we need if (CabInterop.NOTIFICATIONTYPE.ENUMERATE == fdint && 0 == this.fileInfoList.Count) { this.fileInfoList.Capacity = pfdin.Folder; } if (fdint == CabInterop.NOTIFICATIONTYPE.COPY_FILE) { CabinetFileInfo fileInfo = new CabinetFileInfo(pfdin.Psz1, pfdin.Date, pfdin.Time); this.fileInfoList.Add(fileInfo); } return 0; // tell cabinet api to skip this file }
internal static extern void EnumerateCab(string cabinet, CabInterop.PFNNOTIFY notify);