当前位置: 首页>>代码示例>>C#>>正文


C# InvokeOperation类代码示例

本文整理汇总了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);
         }
     });
 }
开发者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,代码来源:


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