Re: Determine which method called the DoneEvent - WeOnlyDo Discussion board

Re: Determine which method called the DoneEvent (General questions)

by Chris Green, Friday, March 17, 2006, 01:49 (6641 days ago) @ wodDrazen

The example was very helpful...

Thank you.

This is how I used it.

private void sftp1_ProgressEvent(object Sender, WeOnlyDo.Client.SFTP.ProgressArgs Args)
{
try
{
sftp1.Tag = test ;
progressBar1.Minimum = 0;
progressBar1.Maximum = (int)Args.Length;
progressBar1.Value = (int)Args.Position;
int uploadedBytes = (int)Args.Position / 1024;
int fileSize = (int)Args.Length / 1024;

lblUploadSize.Text = Convert.ToString(uploadedBytes) + KB/ + Convert.ToString(fileSize) + Kb ;
}
catch (Exception)
{ }
}

private void sftp1_DoneEvent(object Sender, WeOnlyDo.Client.SFTP.DoneArgs Args)
{
this.Cursor = Cursors.Arrow;

if (sftp1.Tag == test )
{
lblUpComp.Text = This worked ;
}
if (Args.Error == null)
{
lblMsg.Text = listed ok ;
AddToList(
***DONE! Awaiting next command... );
}
else
{
lblMsg.Text = Args.Error.Message;
}
}

Is this an ok way to use? Would you forsee any problems with it in the furture?


Complete thread: