Yes! It is fired when the problem is detected.
For instance this snippet fires the event for me (but only if the "file.txt" or "file2.txt" is already present in the current remote directory of the server that I am connecting to):
Sftp sftp = new Sftp();
sftp.ProblemDetected += sftp_ProblemDetected;
sftp.Connect(server);
sftp.Login(username, password);
Task[] tasks = new Task[2];
// upload to the current directory - if the file is already there, the ProblemDetected event will be fired
tasks[0] = sftp.UploadAsync(@"c:\temp\file.txt", ".", 0, 0, 0);
tasks[1] = sftp.UploadAsync(@"c:\temp\file2.txt", ".", 0, 0, 0);
var continuation = Task.Factory.ContinueWhenAll(
tasks,
(e) =>
{
sftp.Disconnect();
Console.WriteLine("Disconnected.");
});
continuation.Wait();
}
static void sftp_ProblemDetected(object sender, SftpProblemDetectedEventArgs e)
{
Console.WriteLine("ProblemDetected event fired.");
}