private async void passwordButton_Click(object sender, EventArgs e)
{
using (var f = new PasswordForm())
{
if (f.ShowDialog() == DialogResult.OK)
{
using (var channel = ChannelManager.CreateChannel())
{
try
{
passwordButton.Enabled = false;
await taskPool.AddTask(channel.Service.ChangeClientPassword(client.Id, f.Password));
}
catch (OperationCanceledException) { }
catch (CommunicationObjectAbortedException) { }
catch (ObjectDisposedException) { }
catch (InvalidOperationException) { }
catch (FaultException exception)
{
UIHelper.Warning(exception.Reason.ToString());
}
catch (Exception exception)
{
UIHelper.Warning(exception.Message);
}
finally
{
passwordButton.Enabled = true;
}
}
}
}
}