コード例 #1
0
ファイル: FTPConnection.cs プロジェクト: tinygg/Tools.Net
 /// <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
ファイル: FTPConnection.cs プロジェクト: tinygg/Tools.Net
 /// <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
ファイル: FTPConnection.cs プロジェクト: tinygg/Tools.Net
 /// <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
ファイル: FTPConnection.cs プロジェクト: tinygg/Tools.Net
 /// <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
ファイル: FTPConnection.cs プロジェクト: tinygg/Tools.Net
 /// <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
ファイル: FTPConnection.cs プロジェクト: tinygg/Tools.Net
 /// <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
ファイル: FTPConnection.cs プロジェクト: Nathan-M-Ross/i360gm
 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
ファイル: FTPConnection.cs プロジェクト: tinygg/Tools.Net
 /// <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
ファイル: FTPConnection.cs プロジェクト: Nathan-M-Ross/i360gm
 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
ファイル: FTPConnection.cs プロジェクト: Nathan-M-Ross/i360gm
 protected internal void RaiseServerDirectoryChanged(FTPDirectoryEventArgs e)
 {
     if (this.areEventsEnabled && (this.ServerDirectoryChanged != null))
     {
         this.InvokeEventHandler(this.ServerDirectoryChanged, this, e);
     }
 }
コード例 #11
0
ファイル: FTPConnection.cs プロジェクト: Nathan-M-Ross/i360gm
 protected internal void RaiseLocalDirectoryChanging(FTPDirectoryEventArgs e)
 {
     if (this.areEventsEnabled && (this.LocalDirectoryChanging != null))
     {
         this.InvokeEventHandler(this.LocalDirectoryChanging, this, e);
     }
 }
コード例 #12
0
ファイル: FTPConnection.cs プロジェクト: Nathan-M-Ross/i360gm
 protected internal void RaiseDeletedDirectory(FTPDirectoryEventArgs e)
 {
     if (this.areEventsEnabled && (this.DeletedDirectory != null))
     {
         this.InvokeEventHandler(this.DeletedDirectory, this, e);
     }
 }
コード例 #13
0
ファイル: FTPConnection.cs プロジェクト: Nathan-M-Ross/i360gm
 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;
 }