本文整理汇总了C#中InvokeOperation.MarkErrorAsHandled方法的典型用法代码示例。如果您正苦于以下问题:C# InvokeOperation.MarkErrorAsHandled方法的具体用法?C# InvokeOperation.MarkErrorAsHandled怎么用?C# InvokeOperation.MarkErrorAsHandled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InvokeOperation
的用法示例。
在下文中一共展示了InvokeOperation.MarkErrorAsHandled方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTimeZonesCompleted
/// <summary>
/// If a class needs the timezones and the list is not already populated they will call the RIA method to populate the list.
/// </summary>
public static void GetTimeZonesCompleted(InvokeOperation<IEnumerable<string>> op)
{
if (op.HasError)
{
op.MarkErrorAsHandled();
}
else
{
TimeZones = op.Value.ToList();
if (op.UserState != null && op.UserState is Action)
{
((Action)op.UserState)();
}
}
}
示例2: AccountSignupOperation_Completed
private void AccountSignupOperation_Completed(InvokeOperation<CreateAccountStatus> operation)
{
if (!operation.IsCanceled)
{
if (operation.HasError)
{
ErrorWindow.CreateNew(operation.Error);
operation.MarkErrorAsHandled();
}
else if (operation.Value == CreateAccountStatus.Success)
{
MessageBox.Show("Success!");
}
else
{
MessageBox.Show("Failure! " + operation.Value.ToString());
}
}
}
示例3: RegistrationOperation_Completed
/// <summary>
/// Completion handler for the registration operation. If there was an error, an
/// <see cref="ErrorWindow"/> is displayed to the user. Otherwise, this triggers
/// a login operation that will automatically log in the just registered user.
/// </summary>
private void RegistrationOperation_Completed(InvokeOperation<CreateUserStatus> operation)
{
if (!operation.IsCanceled)
{
if (operation.HasError)
{
ErrorWindow.CreateNew(operation.Error);
operation.MarkErrorAsHandled();
}
else if (operation.Value == CreateUserStatus.Success)
{
this.registrationData.CurrentOperation = WebContext.Current.Authentication.Login(this.registrationData.ToLoginParameters(), this.LoginOperation_Completed, null);
this.parentWindow.AddPendingOperation(this.registrationData.CurrentOperation);
}
else if (operation.Value == CreateUserStatus.DuplicateUserName)
{
this.registrationData.ValidationErrors.Add(new ValidationResult(ErrorResources.CreateUserStatusDuplicateUserName, new string[] { "UserName" }));
}
else if (operation.Value == CreateUserStatus.DuplicateEmail)
{
this.registrationData.ValidationErrors.Add(new ValidationResult(ErrorResources.CreateUserStatusDuplicateEmail, new string[] { "Email" }));
}
else
{
ErrorWindow.CreateNew(ErrorResources.ErrorWindowGenericError);
}
}
}
示例4: RegistrationOperation_Completed
/// <summary>
/// Completion handler for the registration operation. If there was an error, an
/// <see cref="ErrorWindow"/> is displayed to the user. Otherwise, this triggers
/// a login operation that will automatically log in the just registered user.
/// </summary>
private void RegistrationOperation_Completed(InvokeOperation<CreateUserStatus> operation)
{
if (!operation.IsCanceled)
{
if (operation.HasError)
{
ErrorWindow.CreateNew(operation.Error);
operation.MarkErrorAsHandled();
}
else if (operation.Value == CreateUserStatus.Success)
{
this.DialogResult = true;
}
else if (operation.Value == CreateUserStatus.DuplicateUserName)
{
this.registrationData.ValidationErrors.Add(new ValidationResult(ErrorResources.CreateUserStatusDuplicateUserName, new string[] { "UserName" }));
}
else if (operation.Value == CreateUserStatus.DuplicateEmail)
{
this.registrationData.ValidationErrors.Add(new ValidationResult(ErrorResources.CreateUserStatusDuplicateEmail, new string[] { "Email" }));
}
else
{
ErrorWindow.CreateNew(ErrorResources.ErrorWindowGenericError);
}
}
}
示例5: RegistrationOperation_Completed
/// <summary>
/// Completion handler for the registration operation.
/// If there was an error, an <see cref="ErrorWindow"/> is displayed to the user.
/// Otherwise, this triggers a login operation that will automatically log in the just registered user.
/// </summary>
private void RegistrationOperation_Completed(InvokeOperation operation)
{
if (!operation.IsCanceled)
{
if (operation.HasError)
{
ErrorWindow.CreateNew(operation.Error);
operation.MarkErrorAsHandled();
}
else
{
this.parentWindow.Close();
}
}
}
示例6: LoginOperation_Completed
/// <summary>
/// Completion handler for a <see cref="LoginOperation"/>.
/// If operation succeeds, it closes the window.
/// If it has an error, it displays an <see cref="ErrorWindow"/> and marks the error as handled.
/// If it was not canceled, but login failed, it must have been because credentials were incorrect so a validation error is added to notify the user.
/// </summary>
private void LoginOperation_Completed(InvokeOperation<bool> op)
{
if (op.Value)
{
this.parentWindow.DialogResult = true;
}
else if (op.HasError)
{
MessageBox.Show("Could not change password. Check the current password entered.");
op.MarkErrorAsHandled();
}
}
示例7: RegistrationOperation_Completed
/// <summary>
/// Completion handler for the registration operation. If there was an error, an
/// <see cref="ErrorWindow"/> is displayed to the user. Otherwise, this triggers
/// a login operation that will automatically log in the just registered user.
/// </summary>
private void RegistrationOperation_Completed(InvokeOperation<CreateUserStatus> operation)
{
if (!operation.IsCanceled)
{
if (operation.HasError)
{
if ( operation.Error.Message.Contains( "SQL Server" ) )
{
var mess = new MessageWindow( "Cannot register new user, the database is not accessible. Please check configuration." );
mess.Show();
}
else
ErrorWindow.CreateNew(operation.Error);
operation.MarkErrorAsHandled();
}
else if (operation.Value == CreateUserStatus.Success)
{
this.registrationData.CurrentOperation = WebContext.Current.Authentication.Login(this.registrationData.ToLoginParameters(), this.LoginOperation_Completed, null);
this.parentWindow.AddPendingOperation(this.registrationData.CurrentOperation);
//registrationData.
}
else if (operation.Value == CreateUserStatus.DuplicateUserName)
{
this.registrationData.ValidationErrors.Add(new ValidationResult(ErrorResources.CreateUserStatusDuplicateUserName, new string[] { "UserName" }));
}
else if (operation.Value == CreateUserStatus.DuplicateEmail)
{
this.registrationData.ValidationErrors.Add(new ValidationResult(ErrorResources.CreateUserStatusDuplicateEmail, new string[] { "Email" }));
}
else
{
ErrorWindow.CreateNew(ErrorResources.ErrorWindowGenericError);
}
}
}
示例8: IsAliveComplete
private void IsAliveComplete(InvokeOperation<bool> op)
{
if (op.HasError)
{
m_persistorStatusMessage = op.Error.Message;
m_persistorStatus = ServiceConnectionStatesEnum.Error;
op.MarkErrorAsHandled();
}
else
{
m_persistorStatusMessage = null;
m_persistorStatus = ServiceConnectionStatesEnum.Ok;
}
m_provisioningInitialisationInProgress = false;
UpdateAppStatus();
}
示例9: CopyDialPlanComplete
private void CopyDialPlanComplete(InvokeOperation io)
{
if (io.HasError)
{
LogActivityMessage_External(MessageLevelsEnum.Error, "There was an error copying the dial plan. " + io.Error.Message);
io.MarkErrorAsHandled();
}
else
{
LogActivityMessage_External(MessageLevelsEnum.Info, "The dial plan copy was successful.");
m_dialPlansPanel.RefreshAsync();
}
}
示例10: UpdateCustomerPasswordComplete
private void UpdateCustomerPasswordComplete(InvokeOperation io)
{
if (io.HasError)
{
UIHelper.SetText(m_statusTextBlock, io.Error.Message);
io.MarkErrorAsHandled();
}
else
{
UIHelper.SetText(m_statusTextBlock, "Password successfully updated.");
}
SetUpdateButtonsEnabled(true);
}
示例11: ChangeSIPDialPlanComplete
private void ChangeSIPDialPlanComplete(InvokeOperation io)
{
if (io.HasError)
{
LogActivityMessage_External(MessageLevelsEnum.Error, "There was an error changing the dial plan name. " + io.Error.Message);
io.MarkErrorAsHandled();
UIHelper.SetIsEnabled(_saveButton, true);
UIHelper.SetIsEnabled(_dialPlanNameTextBox, IsEnabled);
}
else
{
string newName = (string)io.UserState;
LogActivityMessage_External(MessageLevelsEnum.Info, "The dial plan name was successfully changed to " + newName + ".");
UIHelper.SetText(_dialPlanNameTextBox, newName);
UIHelper.SetText(m_dialPlanName, newName);
UIHelper.SetVisibility(_dialPlanNameTextBox, System.Windows.Visibility.Collapsed);
UIHelper.SetVisibility(m_dialPlanName, System.Windows.Visibility.Visible);
UIHelper.SetVisibility(_changeButton, System.Windows.Visibility.Visible);
UIHelper.SetVisibility(_saveButton, System.Windows.Visibility.Collapsed);
}
}