Мне нужна метка, которая передается методу AsyncSendRegistration в CallbackMethodSendRegistration.
private delegate ResponceFromServer AsyncSendRegistrationDelegate(RegistrationToUser registrationToUser, Label label);
private ResponceFromServer AsyncSendRegistrationMethod(RegistrationToUser registrationToUser, Label label)
{
SetText(label, registrationToUser.Name + " registration...");
return Requests.DataBase.Authorization.Registration(
registrationToUser.Name,
registrationToUser.IdRoleUser,
registrationToUser.IdGroup);
}
private void CallbackMethodSendRegistration(IAsyncResult ar)
{
var sendRegistrationDelegate = (AsyncSendRegistrationDelegate)ar.AsyncState;
var responceFromServer = (ResponceFromServer)sendRegistrationDelegate.EndInvoke(ar);
if(responceFromServer.IsError)
{
//here need label.Text
}
else
{
}
}