示例#1
0
 /// <summary>Raise the <see cref="LocalDirectoryChanged"/> event.</summary>
 /// <param name="e">Event arguments.</param>
 protected internal void RaiseLocalDirectoryChanged(FTPDirectoryEventArgs e)
 {
     if (areEventsEnabled && LocalDirectoryChanged != null)
         InvokeEventHandler(LocalDirectoryChanged, this, e);
 }
示例#2
0
 /// <summary>Raise the <see cref="ServerDirectoryChanging"/> event.</summary>
 /// <param name="e">Event arguments.</param>
 protected internal void RaiseServerDirectoryChanging(FTPDirectoryEventArgs e)
 {
     if (areEventsEnabled && ServerDirectoryChanging != null)
         InvokeEventHandler(ServerDirectoryChanging, this, e);
 }
示例#3
0
 /// <summary>Raise the <see cref="CreatedDirectory"/> event.</summary>
 /// <param name="e">Event arguments.</param>
 protected internal void RaiseCreatedDirectory(FTPDirectoryEventArgs e)
 {
     if (areEventsEnabled && CreatedDirectory != null)
         InvokeEventHandler(CreatedDirectory, this, e);
 }
示例#4
0
 /// <summary>Raise the <see cref="DeletingDirectory"/> event.</summary>
 /// <param name="e">Event arguments.</param>
 protected internal void RaiseDeletingDirectory(FTPDirectoryEventArgs e)
 {
     if (areEventsEnabled && DeletingDirectory != null)
         InvokeEventHandler(DeletingDirectory, this, e);
 }
示例#5
0
 /// <summary>
 /// Called when the local directory is about to be changed.
 /// </summary>
 /// <param name="oldDirectory">Current directory.</param>
 /// <param name="newDirectory">New directory</param>
 /// <returns><c>true</c> if the operation is to continue.</returns>
 protected virtual bool OnChangingLocalDirectory(string oldDirectory, string newDirectory)
 {
     if (areEventsEnabled && LocalDirectoryChanging != null)
     {
         FTPDirectoryEventArgs e = new FTPDirectoryEventArgs(oldDirectory, newDirectory, DateTime.MinValue, false, null);
         RaiseLocalDirectoryChanging(e);
         return !e.Cancel;
     }
     else
         return true;
 }
示例#6
0
 /// <summary>
 /// Called when a directory is about to be deleted.
 /// </summary>
 /// <param name="dir">Directory name</param>
 /// <returns><c>true</c> if the operation is to continue.</returns>
 protected virtual bool OnDeletingDirectory(string dir)
 {
     if (areEventsEnabled && DeletingDirectory != null)
     {
         if (!PathUtil.IsAbsolute(dir))
             dir = PathUtil.Combine(ServerDirectory, dir);
         FTPDirectoryEventArgs e = new FTPDirectoryEventArgs(dir, dir, DateTime.MinValue, null);
         RaiseDeletingDirectory(e);
         return !e.Cancel;
     }
     else
         return true;
 }
示例#7
0
 protected virtual bool OnChangingServerDirectory(string oldDirectory, string newDirectory)
 {
     if (!this.areEventsEnabled || ((this.ServerDirectoryChanging == null) && (this.DirectoryChanging == null)))
     {
         return true;
     }
     if (!PathUtil.IsAbsolute(oldDirectory))
     {
         oldDirectory = PathUtil.Combine(this.ServerDirectory, oldDirectory);
     }
     if (!PathUtil.IsAbsolute(newDirectory))
     {
         newDirectory = PathUtil.Combine(this.ServerDirectory, newDirectory);
     }
     if (this.ServerDirectoryChanging != null)
     {
         FTPDirectoryEventArgs args = new FTPDirectoryEventArgs(oldDirectory, newDirectory, false, null);
         this.RaiseServerDirectoryChanging(args);
         return !args.Cancel;
     }
     FTPDirectoryEventArgs e = new FTPDirectoryEventArgs(oldDirectory, newDirectory, false, null);
     this.RaiseServerDirectoryChanging(e);
     return !e.Cancel;
 }
示例#8
0
 /// <summary>
 /// Called when the server directory is about to be changed.
 /// </summary>
 /// <param name="oldDirectory">Current directory.</param>
 /// <param name="newDirectory">New directory</param>
 /// <returns><c>true</c> if the operation is to continue.</returns>
 protected virtual bool OnChangingServerDirectory(string oldDirectory, string newDirectory)
 {
     if (areEventsEnabled && (ServerDirectoryChanging != null || DirectoryChanging != null))
     {
         if (!PathUtil.IsAbsolute(oldDirectory))
             oldDirectory = PathUtil.Combine(ServerDirectory, oldDirectory);
         if (!PathUtil.IsAbsolute(newDirectory))
             newDirectory = PathUtil.Combine(ServerDirectory, newDirectory);
         if (ServerDirectoryChanging != null)
         {
             FTPDirectoryEventArgs e = new FTPDirectoryEventArgs(oldDirectory, newDirectory, DateTime.MinValue, false, null);
             RaiseServerDirectoryChanging(e);
             return !e.Cancel;
         }
         else // if (DirectoryChanging != null)
         {
             FTPDirectoryEventArgs e = new FTPDirectoryEventArgs(oldDirectory, newDirectory, DateTime.MinValue, false, null);
             RaiseServerDirectoryChanging(e);
             return !e.Cancel;
         }
     }
     else
         return true;
 }
示例#9
0
 protected virtual bool OnChangingLocalDirectory(string oldDirectory, string newDirectory)
 {
     if (this.areEventsEnabled && (this.LocalDirectoryChanging != null))
     {
         FTPDirectoryEventArgs e = new FTPDirectoryEventArgs(oldDirectory, newDirectory, false, null);
         this.RaiseLocalDirectoryChanging(e);
         return !e.Cancel;
     }
     return true;
 }
示例#10
0
 protected internal void RaiseServerDirectoryChanged(FTPDirectoryEventArgs e)
 {
     if (this.areEventsEnabled && (this.ServerDirectoryChanged != null))
     {
         this.InvokeEventHandler(this.ServerDirectoryChanged, this, e);
     }
 }
示例#11
0
 protected internal void RaiseLocalDirectoryChanging(FTPDirectoryEventArgs e)
 {
     if (this.areEventsEnabled && (this.LocalDirectoryChanging != null))
     {
         this.InvokeEventHandler(this.LocalDirectoryChanging, this, e);
     }
 }
示例#12
0
 protected internal void RaiseDeletedDirectory(FTPDirectoryEventArgs e)
 {
     if (this.areEventsEnabled && (this.DeletedDirectory != null))
     {
         this.InvokeEventHandler(this.DeletedDirectory, this, e);
     }
 }
示例#13
0
 protected virtual bool OnDeletingDirectory(string dir)
 {
     if (!this.areEventsEnabled || (this.DeletingDirectory == null))
     {
         return true;
     }
     if (!PathUtil.IsAbsolute(dir))
     {
         dir = PathUtil.Combine(this.ServerDirectory, dir);
     }
     FTPDirectoryEventArgs e = new FTPDirectoryEventArgs(null, dir, null);
     this.RaiseDeletingDirectory(e);
     return !e.Cancel;
 }