I decompiled a program built with .NET 1.1 and I need to rewrite in .NET 2.0 or above. I have difficulty understanding this code, and event is not my strong point. Visual Studio complains
"The event 'dataTransfering' can only appear on the hand side of += or -="
public delegate void DataTransferringDelegate(string name, long transBytes, long totalBytes);
public event DataTransferringDelegate dataTransferring
{
[MethodImpl(32)]
add
{
this.dataTransferring = (FtpIO.DataTransferringDelegate)Delegate.Combine(this.dataTransferring, value);
}
[MethodImpl(32)]
remove
{
this.dataTransferring = (FtpIO.DataTransferringDelegate)Delegate.Remove(this.dataTransferring, value);
}
}
public void upload(string fileName, bool resume)
{
long length;
long num2 = 0L;
// some code removed here
this.dataTransferring(fileName, num2, length);
}
So how to fix this code in .NET 2.0?