示例#1
0
        /// <summary>
        /// Performs a directory creation.
        /// </summary>
        /// <param name="fileSystem">The file system.</param>
        /// <param name="sourceDirectory">The source directory.</param>
        /// <param name="targetDirectory">The target directory.</param>
        /// <param name="execute">if set to true, the operation gets executed.</param>
        private void PerformDirectoryCreationOperation(IFileSystem fileSystem, IDirectoryInfo sourceDirectory, IDirectoryInfo targetDirectory, bool execute)
        {
            var eventArgs = new DirectoryCreationEventArgs(sourceDirectory, targetDirectory);

            this.OnCreatingDirectory(eventArgs);

            if (execute)
            {
                try
                {
                    fileSystem.CreateDirectory(sourceDirectory, targetDirectory);

                    this.OnCreatedDirectory(eventArgs);
                }

                catch (AccessException)
                {
                    this.excludedPaths.Add(NormalizePath(targetDirectory.FullName));
                    this.OnDirectoryCreationError(new DirectoryCreationEventArgs(sourceDirectory, targetDirectory));
                }
            }
        }
示例#2
0
        /// <summary>
        /// Performs a directory creation.
        /// </summary>
        /// <param name="fileSystem">The file system.</param>
        /// <param name="sourceDirectory">The source directory.</param>
        /// <param name="targetDirectory">The target directory.</param>
        /// <param name="execute">if set to true, the operation gets executed.</param>
        private void PerformDirectoryCreationOperation(IFileSystem fileSystem, IDirectoryInfo sourceDirectory, IDirectoryInfo targetDirectory, bool execute)
        {
            var eventArgs = new DirectoryCreationEventArgs(sourceDirectory, targetDirectory);

            this.OnCreatingDirectory(eventArgs);

            if (execute)
            {
                try
                {
                    fileSystem.CreateDirectory(sourceDirectory, targetDirectory);

                    this.OnCreatedDirectory(eventArgs);
                }

                catch (AccessException)
                {
                    this.excludedPaths.Add(NormalizePath(targetDirectory.FullName));
                    this.OnDirectoryCreationError(new DirectoryCreationEventArgs(sourceDirectory, targetDirectory));
                }
            }
        }
示例#3
0
 /// <summary>
 /// Raises the <see cref="DirectoryCreationError"/> event.
 /// </summary>
 /// <param name="e">The <see cref="FlagSync.Core.DirectoryCreationEventArgs"/> instance containing the event data.</param>
 protected virtual void OnDirectoryCreationError(DirectoryCreationEventArgs e)
 {
     this.DirectoryCreationError.RaiseSafe(this, e);
 }
示例#4
0
 /// <summary>
 /// Raises the <see cref="CreatingDirectory"/> event.
 /// </summary>
 /// <param name="e">The <see cref="FlagSync.Core.DirectoryCreationEventArgs"/> instance containing the event data.</param>
 protected virtual void OnCreatingDirectory(DirectoryCreationEventArgs e)
 {
     this.CreatingDirectory.RaiseSafe(this, e);
 }
示例#5
0
 /// <summary>
 /// Handles the CreatedDirectory event of the currentJob control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="FlagSync.Core.DirectoryCreationEventArgs"/> instance containing the event data.</param>
 private void currentJob_CreatedDirectory(object sender, DirectoryCreationEventArgs e)
 {
     this.CreatedDirectory.RaiseSafe(this, e);
 }
示例#6
0
 /// <summary>
 /// Handles the DirectoryCreationError event of the currentJob control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="FlagSync.Core.DirectoryCreationEventArgs"/> instance containing the event data.</param>
 private void currentJob_DirectoryCreationError(object sender, DirectoryCreationEventArgs e)
 {
     this.DirectoryCreationError.RaiseSafe(this, e);
 }
示例#7
0
 /// <summary>
 /// Handles the CreatedDirectory event of the currentJob control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="FlagSync.Core.DirectoryCreationEventArgs"/> instance containing the event data.</param>
 private void currentJob_CreatedDirectory(object sender, DirectoryCreationEventArgs e)
 {
     this.CreatedDirectory.RaiseSafe(this, e);
 }
示例#8
0
 /// <summary>
 /// Handles the DirectoryCreationError event of the currentJob control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="FlagSync.Core.DirectoryCreationEventArgs"/> instance containing the event data.</param>
 private void currentJob_DirectoryCreationError(object sender, DirectoryCreationEventArgs e)
 {
     this.DirectoryCreationError.RaiseSafe(this, e);
 }
示例#9
0
 /// <summary>
 /// Raises the <see cref="DirectoryCreationError"/> event.
 /// </summary>
 /// <param name="e">The <see cref="FlagSync.Core.DirectoryCreationEventArgs"/> instance containing the event data.</param>
 protected virtual void OnDirectoryCreationError(DirectoryCreationEventArgs e)
 {
     this.DirectoryCreationError.RaiseSafe(this, e);
 }
示例#10
0
 /// <summary>
 /// Raises the <see cref="CreatedDirectory"/> event.
 /// </summary>
 /// <param name="e">The <see cref="FlagSync.Core.DirectoryCreationEventArgs"/> instance containing the event data.</param>
 protected virtual void OnCreatedDirectory(DirectoryCreationEventArgs e)
 {
     this.CreatedDirectory.RaiseSafe(this, e);
 }