• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# InvokeOperation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中InvokeOperation的典型用法代码示例。如果您正苦于以下问题:C# InvokeOperation类的具体用法?C# InvokeOperation怎么用?C# InvokeOperation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



InvokeOperation类属于命名空间,在下文中一共展示了InvokeOperation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
         }
     });
 }
开发者ID:ramirobr,项目名称:VOCIraq,代码行数:29,代码来源:LoginViewModel.cs


示例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;
		}
开发者ID:,项目名称:,代码行数:13,代码来源:


示例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));
     }
 }
开发者ID:jorgeds001,项目名称:CodeSamples,代码行数:14,代码来源:MainPage.xaml.cs


示例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)();
                }
            }
        }
开发者ID:sipsorcery,项目名称:sipsorcery,代码行数:19,代码来源:Page.xaml.cs


示例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());
         }
     }
 }
开发者ID:garethconner,项目名称:Corkboard,代码行数:19,代码来源:Signup.xaml.cs


示例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();
     });
 }
开发者ID:ramirobr,项目名称:VOCIraq,代码行数:14,代码来源:CertificateListViewModel.cs


示例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);
     });
 }
开发者ID:ramirobr,项目名称:VOCIraq,代码行数:14,代码来源:CertificateListViewModel.cs


示例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);

            });
        }
开发者ID:ramirobr,项目名称:VOCIraq,代码行数:14,代码来源:CertificateListViewModel.cs


示例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();
     });
 }
开发者ID:ramirobr,项目名称:VOCIraq,代码行数:13,代码来源:CertificateListViewModel.cs


示例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);
         }
     }
 }
开发者ID:k0stya,项目名称:quizApp,代码行数:32,代码来源:NewUser.xaml.cs


示例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;
     });
 }
开发者ID:ramirobr,项目名称:VOCIraq,代码行数:25,代码来源:UserViewModel.cs


示例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;
            }
        }
开发者ID:Jitlee,项目名称:WPFMonitor,代码行数:46,代码来源:ImagesUploadViewModel.cs


示例13: InvokeOperationEventArgs

 public InvokeOperationEventArgs(InvokeOperation invokeOp)
     : base(null)
 {
     InvokeOp = invokeOp;
 }
开发者ID:carriercomm,项目名称:InventoryManagement,代码行数:5,代码来源:InvokeOperationEventArgs.cs


示例14: ProductProvinceGroup_Deleted

 private void ProductProvinceGroup_Deleted(InvokeOperation op)
 {
     if (op.Error == null)
     {
         SaveAll(GroupingNameTbx.Text, _groups, GetSelectedProductsIds());
     }
 }
开发者ID:naimheshmati,项目名称:Sanofi,代码行数:7,代码来源:SelectProductWindow.xaml.cs


示例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;
		}
开发者ID:,项目名称:,代码行数:16,代码来源:


示例16: OnRegisterCompletedStep4

		private void OnRegisterCompletedStep4(InvokeOperation operation)
		{
			string errorStatus = operation.CheckErrorStatus();
			if (errorStatus != null)
			{
				MessageBoxEx.ShowError("Register account", errorStatus, null);
				return;
			}
		}
开发者ID:,项目名称:,代码行数:9,代码来源:


示例17: OnDeleteUserCompleted

		private void OnDeleteUserCompleted(InvokeOperation<bool> operation)
		{
			x_Signin.IsEnabled = true;
			string errorStatus = operation.CheckErrorStatus();
			bool deleted = (errorStatus == null && operation.Value == true);
			x_SignInErrorStatus.Text = string.Format("User account '{0}' was{1} deleted", SignInUserName, (deleted ? "" : " NOT"));
			x_SignInErrorStatus.Visibility = Visibility.Visible;
		}
开发者ID:,项目名称:,代码行数:8,代码来源:


示例18: LoadResultsIntoGrid

 private void LoadResultsIntoGrid(InvokeOperation<IEnumerable<Task>> op)
 {
     this.TaskGrid.ItemsSource = op.Value;
 }
开发者ID:Mart-Bogdan,项目名称:autofac-examples,代码行数:4,代码来源:MainPage.xaml.cs


示例19: UserAlreadyExistCompleted

        /// <summary>
        /// Execute when a user was been validated
        /// </summary>
        /// <param name="operation">Operation result</param>
        private void UserAlreadyExistCompleted(InvokeOperation operation)
        {
            HandleInvokeOperation(operation, () =>
            {
                if ((bool)operation.Value == true)
                {
                    AlertDisplay(Strings.UserAlreadyExists);
                    return;
                }

                if (_user.EntityState == EntityState.Detached)
                {
                    _context.UserProfiles.Add(_user);
                    _user.UserInRoles.Add(new UserInRole { RoleId = _roleIdSelected.Value });
                }
                else
                    if (!_user.UserInRoles.Any(x => x.RoleId == _roleIdSelected))
                    {
                        foreach (var role in _user.UserInRoles)
                        {
                            _user.UserInRoles.Remove(role);
                            _context.UserInRoles.Remove(role);
                        }
                        _context.UserInRoles.Add(new UserInRole { UserId = _user.UserId, RoleId = _roleIdSelected.Value });
                    }
                _context.SubmitChanges(SaveCompleted, null);

            });
        }
开发者ID:ramirobr,项目名称:VOCIraq,代码行数:33,代码来源:UserViewModel.cs


示例20: UnCloseCertificateListCompleted

 /// <summary>
 /// Method is executed when UnCloseCertificateList is completed
 /// </summary>
 /// <param name="operation"></param>
 private void UnCloseCertificateListCompleted(InvokeOperation<List<ValidationMessage>> operation)
 {
     HandleInvokeOperation(operation, () =>
     {
         List<ValidationMessage> messages = operation.Value;
         showMultipleActionResult(messages, Strings.ActionTypeUnclosed);
         Refresh();
     });
 }
开发者ID:ramirobr,项目名称:VOCIraq,代码行数:13,代码来源:CertificateListViewModel.cs



注:本文中的InvokeOperation类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# InvokeOptions类代码示例发布时间:2022-05-24
下一篇:
C# Invoice类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap