Esempio n. 1
0
 /// <summary>
 /// Raises the <see cref="FilePlaced"/> event.
 /// </summary>
 /// <param name="e">A FilePlacedEventArgs that contains the event data.</param>
 protected virtual void OnFilePlaced(FilePlacedEventArgs e)
 {
     Trace.WriteLine("OnFilePlaced");
     if (FilePlaced != null)
     {
         FilePlaced(this, e);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Receives notification when a file is placed on the cabinet.
        /// </summary>
        /// <param name="ccab">Current cab file parameters.</param>
        /// <param name="fileName">Name of the file that was placed.</param>
        /// <param name="cbFile">Size of the placed file.</param>
        /// <param name="fContinuation">A flag that indicates whether this file is a continuation from another folder or cabinet.</param>
        /// <param name="pUserData">User data object.</param>
        /// <returns>Returns 0 on success.  Returns -1 on failure.</returns>
        /// <remarks>The File Compression Interface calls this function when a file has been placed in a cabinet.
        /// This is purely a notification message.  Clients that want to be notified of this event must handle the
        /// FilePlaced event raised by this function.</remarks>
        protected virtual int FilePlacedCallback(
            FciCurrentCab ccab,
            string fileName,
            Int32 cbFile,
            bool fContinuation,
            IntPtr pUserData)
        {
            Trace.WriteLine("FilePlacedCallback");
            Trace.WriteLine(string.Format("UserDataPointer = {0}", pUserData));
            Trace.Flush();
            FilePlacedEventArgs e = new FilePlacedEventArgs(ccab, fileName, cbFile, fContinuation,
                                                            GetUserDataObject(pUserData));

            try
            {
                OnFilePlaced(e);
            }
            catch (Exception)
            {
                e.Result = -1;
            }
            return(e.Result);
        }