本文整理汇总了C#中InvokeOperation类的典型用法代码示例。如果您正苦于以下问题:C# InvokeOperation类的具体用法?C# InvokeOperation怎么用?C# InvokeOperation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InvokeOperation类属于命名空间,在下文中一共展示了InvokeOperation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PerformAuthenticationCompleted
private void PerformAuthenticationCompleted(InvokeOperation<VocUser> operation)
{
HandleInvokeOperation(operation, () =>
{
IsBusy = false;
VocUser user = operation.Value;
if (user != null)
{
if (user.IsCoordinatorOrSuperior || user.IsBorderAgentOrSuperior)
{
//Get the list of entry points
StaticReferences.GetEntryPoints(() =>
{
App.CurrentUser = operation.Value;
if (ChangeScreen != null)
ChangeScreen(this, new EventArgs());
});
}
else
{
MessageBox.Show(Strings.NonAuthorizedMessage);
}
}
else
{
MessageBox.Show(Strings.NonAuthorizedMessage);
}
});
}
示例2: OnSendEmailCompleted
private void OnSendEmailCompleted(InvokeOperation operation)
{
x_OK.IsEnabled = true;
string errorStatus = operation.CheckErrorStatus();
if (errorStatus != null)
{
x_ErrorStatus.Text = errorStatus;
return;
}
x_ErrorStatus.Text = null;
DialogResult = MessageBoxResult.OK;
}
示例3: CallBack_GetMessage
private void CallBack_GetMessage(InvokeOperation<string> getMessageOperation)
{
if (getMessageOperation.HasError)
{
MessageBox.Show(String.Format("Error found!\n {0}.\nStackTrace\n{1}", getMessageOperation.Error.Message, getMessageOperation.Error.StackTrace));
}
else
{
this.Message.Text = String.Format("{0}The server response is:\t\n{1}\n{2}",
this.Message.Text,
getMessageOperation.Value,
string.Format("[Client Got its Callback At]{0}", DateTime.Now));
}
}
示例4: 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)();
}
}
}
示例5: 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());
}
}
}
示例6: PublishUnplishCertificateCompleted
/// <summary>
/// Callback method of PublisUnpublishCertificateList
/// </summary>
/// <param name="operation">Operation</param>
private void PublishUnplishCertificateCompleted(InvokeOperation<List<ValidationMessage>> operation)
{
HandleInvokeOperation(operation, delegate
{
bool isPublished = bool.Parse(operation.UserState.ToString());
List<ValidationMessage> messages = operation.Value;
showMultipleActionResult(messages, isPublished ? Strings.ActionTypePublished : Strings.ActionTypeUnpublished);
Refresh();
});
}
示例7: GetDocumentDone
/// <summary>
/// On done getting document
/// </summary>
/// <param name="operation">Operation result</param>
private void GetDocumentDone(InvokeOperation<Document> operation)
{
HandleInvokeOperation(operation, () =>
{
CertificateViewModel certificateViewModel = new CertificateViewModel();
certificateViewModel.Initialize(_context);
certificateViewModel.Certificate = operation.UserState as Certificate;
certificateViewModel.DisplayCertificateFile(operation.Value);
});
}
示例8: ExportCertificatesToExcelCompleted
/// <summary>
/// Completed method for GetAllCertificates
/// </summary>
/// <param name="operation">Operation result</param>
private void ExportCertificatesToExcelCompleted(InvokeOperation<string> operation)
{
HandleInvokeOperation(operation, delegate
{
string path= operation.Value.ToString();
IsBusy = false;
DownloadCertificateExcelFile(path);
});
}
示例9: CompletedExecuteSendComdivCommand
/// <summary>
/// Call back method for SynchronizeWithComdivList
/// </summary>
/// <param name="operation"></param>
private void CompletedExecuteSendComdivCommand(InvokeOperation<List<ValidationMessage>> operation)
{
HandleInvokeOperation(operation, () =>
{
List<ValidationMessage> messages = operation.Value;
showMultipleActionResult(messages, Strings.ActionTypeSyncComdiv);
Refresh();
});
}
示例10: 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);
}
}
}
示例11: GetUserInformationByEmailCompleted
/// <summary>
/// Callback method for GetUserInformationByEmail
/// </summary>
/// <param name="operation"></param>
private void GetUserInformationByEmailCompleted(InvokeOperation<UserProfile> operation)
{
HandleInvokeOperation(operation, delegate
{
//set the information
if (operation.Value != null)
{
User.FirstName = operation.Value.FirstName;
User.LastName = operation.Value.LastName;
User.UserName = operation.Value.UserName;
OnPropertyChanged("User");
OnPropertyChanged("UserName");
}
else
{
// When the user is not found we don't need to blank any field, just display an alert message.
AlertDisplay(Strings.UserNotFoundByEmail);
}
IsBusy = false;
});
}
示例12: UploadCallback
private void UploadCallback(InvokeOperation<int> result)
{
var file = result.UserState as ImageUploadModel;
if (file.IsDeleted)
{
return;
}
if (file.IsDeleting)
{
Delete(file);
return;
}
if (!result.HasError && result.Value == 0)
{
var finished = Math.Min(BUFFER_SIZE, file.FileSize - file.Ready);
file.Ready += finished;
TotalReady += finished;
Upload(file);
}
else
{
file.IsFailed = true;
TotalReady += file.FileSize - file.Ready;
}
var failedCount = _items.Count(f => f.IsFailed);
if (TotalReady == TotalSize)
{
Result = "图片都已上传成功!";
ResultBrush = new SolidColorBrush(Colors.Blue);
_isCompleted = true;
}
else if (failedCount == _items.Count)
{
Result = _items.Count == 1 ? "图片上传失败" : "图片全部上传失败!";
ResultBrush = new SolidColorBrush(Colors.Red);
_isCompleted = true;
}
else if(_items.Count(f => !f.IsCompleted && !f.IsFailed) == 0)
{
Result = string.Format("成功上传{0}张,失败{1}张,中途取消{2}张", _items.Count - failedCount, failedCount, _removeCount);
ResultBrush = new SolidColorBrush(Colors.Red);
_isCompleted = true;
}
}
示例13: InvokeOperationEventArgs
public InvokeOperationEventArgs(InvokeOperation invokeOp)
: base(null)
{
InvokeOp = invokeOp;
}
示例14: ProductProvinceGroup_Deleted
private void ProductProvinceGroup_Deleted(InvokeOperation op)
{
if (op.Error == null)
{
SaveAll(GroupingNameTbx.Text, _groups, GetSelectedProductsIds());
}
}
示例15: OnRecoverCompleted
private void OnRecoverCompleted(InvokeOperation operation)
{
x_Recover.IsEnabled = true;
string errorStatus = operation.CheckErrorStatus();
if (errorStatus != null)
{
x_RecoverErrorStatus.Text = errorStatus;
x_RecoverErrorStatus.Visibility = Visibility.Visible;
return;
}
x_RecoverErrorStatus.Text = null;
x_RecoverErrorStatus.Visibility = Visibility.Collapsed;
base.Closed += OnRecoverDialogClosed;
DialogResult = MessageBoxResult.OK;
}