Replace This:
bn.TransferProgress += OnEventProgress();
With This:
bn.TransferProgress += OnEventProgress;
Вопрос
in my windows phone c# application i have this problem
my code:
public class mainclass
{
private void myfunc()
{
BinaryTransfer bn = new BinaryTransfer(params);
bn.TransferProgress += OnEventProgress();
}
private void OnEventProgress(object sender, BinaryTransferProgress e)
{
Console.WriteLine("OK");
}
}
public class BinaryTransferProgress
{
public ulong Progress { get; set; }
public ulong Size { get; set; }
}
public class BinaryTransfer
{
...... CODE ....
public event EventHandler<BinaryTransferProgress> TransferProgress;
}
in this row i have error
No method overload OnEventProgress takes 0 arguments
bn.TransferProgress += OnEventProgress()
why?
Решение
Replace This:
bn.TransferProgress += OnEventProgress();
With This:
bn.TransferProgress += OnEventProgress;