private async void saveButton_Click(object sender, EventArgs e)
{
try
{
saveButton.Enabled = false;
using (var channel = UserChannelManager.CreateChannel())
{
Administrator = await taskPool.AddTask(channel.Service.EditAdministrator(administrator));
}
if (Saved != null)
{
Saved(this, EventArgs.Empty);
}
}
catch (OperationCanceledException) { }
catch (CommunicationObjectAbortedException) { }
catch (ObjectDisposedException) { }
catch (InvalidOperationException) { }
catch (FaultException exception)
{
UIHelper.Warning(exception.Reason.ToString());
}
catch (Exception exception)
{
UIHelper.Warning(exception.Message);
}
finally
{
saveButton.Enabled = true;
}
}