/// <summary> /// Raises the <see cref="NextCabinet"/> event. /// </summary> /// <param name="e">A NextCabinetEventArgs that contains the event data.</param> protected virtual void OnNextCabinet(NextCabinetEventArgs e) { Trace.WriteLine("OnNextCabinet"); if (NextCabinet != null) NextCabinet(this, e); }
/// <summary> /// Gets the name of the next cabinet file. /// </summary> /// <param name="ccab">Current cabinet information.</param> /// <param name="cbPrevCab">Number of the previous cabinet file.</param> /// <param name="pUserData">User data object.</param> /// <returns>Returns True on success, and the name of the new cabinet file is stored in ccab.CabName. /// Returns False on error.</returns> /// <remarks>The File Compression Interface (FCI) calls this function to get the name of the next cabinet file. /// Clients must respond to the NextCabinet event raised by this function and supply the next cabinet file name.</remarks> protected virtual bool GetNextCabinet( FciCurrentCab ccab, int cbPrevCab, IntPtr pUserData) { Trace.WriteLine("GetNextCabinet"); Trace.WriteLine(string.Format("UserDataPointer = {0}", pUserData)); Trace.Flush(); Trace.WriteLine(string.Format("UserData = {0}", GetUserDataObject(pUserData))); Trace.Flush(); NextCabinetEventArgs e = new NextCabinetEventArgs(ccab, cbPrevCab, GetUserDataObject(pUserData)); Trace.WriteLine("Created event args"); try { OnNextCabinet(e); } catch (Exception ex) { Trace.WriteLine(ex); e.Result = false; } return e.Result; }