Example #1
0
 /// <summary>
 /// Raises the <see cref="NotifyEnumerate"/> event.
 /// </summary>
 /// <param name="e">A <see cref="NotifyEventArgs"/> that contains the event data.</param>
 protected virtual void OnNotifyEnumerate(NotifyEventArgs e)
 {
     Trace.WriteLine("OnNotifyEnumerate");
     if (NotifyEnumerate != null)
         NotifyEnumerate(this, e);
 }
Example #2
0
 /// <summary>
 /// Raises the <see cref="NotifyNextCabinet"/> event.
 /// </summary>
 /// <param name="e">A <see cref="NotifyEventArgs"/> that contains the event data.</param>
 protected virtual void OnNotifyNextCabinet(NotifyEventArgs e)
 {
     Trace.WriteLine("OnNotifyNextCabinet");
     if (NotifyNextCabinet != null)
         NotifyNextCabinet(this, e);
 }
Example #3
0
 /// <summary>
 /// Raises the <see cref="NotifyCabinetInfo"/> event.
 /// </summary>
 /// <param name="e">A <see cref="NotifyEventArgs"/> that contains the event data.</param>
 protected virtual void OnNotifyCabinetInfo(NotifyEventArgs e)
 {
     Trace.WriteLine("OnNotifyCabinetInfo");
     if (NotifyCabinetInfo != null)
         NotifyCabinetInfo(this, e);
 }
Example #4
0
 /// <summary>
 /// Raises the <see cref="NotifyCloseFile"/> event.
 /// </summary>
 /// <param name="e">A <see cref="NotifyEventArgs"/> that contains the event data.</param>
 protected virtual void OnNotifyCloseFile(NotifyEventArgs e)
 {
     Trace.WriteLine("OnNotifyCloseFile");
     if (NotifyCloseFile != null)
         NotifyCloseFile(this, e);
 }
Example #5
0
        /// <summary>
        /// Receives notification callbacks from the File Decompression Interface (FDI).
        /// </summary>
        /// <param name="fdint">A <see cref="FdiNotificationType"/> value that specifies which notification is being sent.</param>
        /// <param name="fdin">A <see cref="FdiNotification"/> that contains information about the notification</param>
        /// <returns>The return value is dependent on the notification type.</returns>
        /// <remarks>The File Decompression Interface (FDI)provides notifications for six different events.  Clients must respond to those
        /// notifications by handling the <see cref="NotifyCabinetInfo"/>, <see cref="NotifyCloseFile"/>, <see cref="NotifyCopyFile"/>,
        /// <see cref="NotifyEnumerate"/>, <see cref="NotifyNextCabinet"/>, and <see cref="NotifyPartialFile"/> events.</remarks>
        internal virtual int NotifyCallback(FdiNotificationType fdint, FdiNotification fdin)
        {
            Trace.WriteLine(string.Format("NotifyCallback: type {0}", fdint));

            NotifyEventArgs e = new NotifyEventArgs(fdin);

            // fire the proper event
            switch (fdint)
            {
                case FdiNotificationType.CabinetInfo:
                    OnNotifyCabinetInfo(e);
                    break;
                case FdiNotificationType.CloseFileInfo:
                    OnNotifyCloseFile(e);
                    break;
                case FdiNotificationType.CopyFile:
                    OnNotifyCopyFile(e);
                    break;
                case FdiNotificationType.Enumerate:
                    OnNotifyEnumerate(e);
                    break;
                case FdiNotificationType.NextCabinet:
                    OnNotifyNextCabinet(e);
                    break;
                case FdiNotificationType.PartialFile:
                    OnNotifyPartialFile(e);
                    break;
            }
            return e.Result;
        }