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


C# InvokeOperation.MarkErrorAsHandled方法代码示例

本文整理汇总了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)();
                }
            }
        }
开发者ID:sipsorcery,项目名称:sipsorcery,代码行数:19,代码来源:Page.xaml.cs

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

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

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

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

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

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

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

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

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

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


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