/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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; }
/// <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; }
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; }
/// <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; }
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; }
protected internal void RaiseServerDirectoryChanged(FTPDirectoryEventArgs e) { if (this.areEventsEnabled && (this.ServerDirectoryChanged != null)) { this.InvokeEventHandler(this.ServerDirectoryChanged, this, e); } }
protected internal void RaiseLocalDirectoryChanging(FTPDirectoryEventArgs e) { if (this.areEventsEnabled && (this.LocalDirectoryChanging != null)) { this.InvokeEventHandler(this.LocalDirectoryChanging, this, e); } }
protected internal void RaiseDeletedDirectory(FTPDirectoryEventArgs e) { if (this.areEventsEnabled && (this.DeletedDirectory != null)) { this.InvokeEventHandler(this.DeletedDirectory, this, e); } }
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; }