コード例 #1
0
ファイル: Job.cs プロジェクト: dineshkummarc/FlagSync
        /// <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
ファイル: Job.cs プロジェクト: dineshkummarc/FlagSync
        /// <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
ファイル: Job.cs プロジェクト: dineshkummarc/FlagSync
 /// <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
ファイル: Job.cs プロジェクト: dineshkummarc/FlagSync
 /// <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
ファイル: JobWorker.cs プロジェクト: SmartFire/FlagSync
 /// <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
ファイル: JobWorker.cs プロジェクト: SmartFire/FlagSync
 /// <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
ファイル: JobWorker.cs プロジェクト: yakkobr/FlagSync
 /// <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
ファイル: JobWorker.cs プロジェクト: yakkobr/FlagSync
 /// <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
ファイル: Job.cs プロジェクト: dineshkummarc/FlagSync
 /// <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
ファイル: Job.cs プロジェクト: dineshkummarc/FlagSync
 /// <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);
 }