public CopyProgressData(FileInfo source, FileInfo destination, CopyFileHandler callback, object state)
 {
     this._source      = source;
     this._destination = destination;
     this._callback    = callback;
     this._state       = state;
 }
        public static void CopyFile(FileInfo source, FileInfo destination,
                                    Statements.FileCopyOptions options, CopyFileHandler callback, object state)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (destination == null)
            {
                throw new ArgumentNullException("destination");
            }

            new FileIOPermission(FileIOPermissionAccess.Read, source.FullName).Demand();
            new FileIOPermission(FileIOPermissionAccess.Write, destination.FullName).Demand();

            CopyProgressRoutine cpr = (callback == null) ? null : new CopyProgressRoutine(
                new CopyProgressData(source, destination, callback, state).CallbackHandler);

            bool cancel = false;

            if (!NativeMethod.CopyFileEx(source.FullName, destination.FullName, cpr, IntPtr.Zero, ref cancel, (int)options))
            {
                throw new IOException(new Win32Exception().Message);
            }
        }
        public static void CopyFile(FileInfo source, FileInfo destination,
            Statements.FileCopyOptions options, CopyFileHandler callback, object state)
        {
            if (source == null) throw new ArgumentNullException("source");
            if (destination == null) throw new ArgumentNullException("destination");

            new FileIOPermission(FileIOPermissionAccess.Read, source.FullName).Demand();
            new FileIOPermission(FileIOPermissionAccess.Write, destination.FullName).Demand();

            CopyProgressRoutine cpr = (callback == null) ? null : new CopyProgressRoutine(
                new CopyProgressData(source, destination, callback, state).CallbackHandler);

            bool cancel = false;
            if (!NativeMethod.CopyFileEx(source.FullName, destination.FullName, cpr, IntPtr.Zero, ref cancel, (int)options))
                throw new IOException(new Win32Exception().Message);
        }
 public static void CopyFile(FileInfo source, FileInfo destination,
                             Statements.FileCopyOptions options, CopyFileHandler callback)
 {
     CopyFile(source, destination, options, callback, null);
 }
 public CopyProgressData(FileInfo source, FileInfo destination, CopyFileHandler callback, object state)
 {
     this._source = source;
     this._destination = destination;
     this._callback = callback;
     this._state = state;
 }
 public static void CopyFile(FileInfo source, FileInfo destination,
     Statements.FileCopyOptions options, CopyFileHandler callback)
 {
     CopyFile(source, destination, options, callback, null);
 }