Ejemplo n.º 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));
                }
            }
        }
Ejemplo n.º 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));
                }
            }
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }