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


C# LoadOperation.MarkErrorAsHandled方法代码示例

本文整理汇总了C#中LoadOperation.MarkErrorAsHandled方法的典型用法代码示例。如果您正苦于以下问题:C# LoadOperation.MarkErrorAsHandled方法的具体用法?C# LoadOperation.MarkErrorAsHandled怎么用?C# LoadOperation.MarkErrorAsHandled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LoadOperation的用法示例。


在下文中一共展示了LoadOperation.MarkErrorAsHandled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnDistinctValuesLoaded

		private void OnDistinctValuesLoaded(LoadOperation<DistinctValue> loadOperation)
		{
			IList<string> distinctValuesList = (IList<string>)loadOperation.UserState;
			
			if (loadOperation.HasError)
			{
				loadOperation.MarkErrorAsHandled();
				return;
			}

			foreach (DistinctValue dv in loadOperation.Entities)
			{
				distinctValuesList.Add(dv.Value);
			}
		}
开发者ID:netintellect,项目名称:PluralsightSpaJumpStartFinal,代码行数:15,代码来源:Example.xaml.cs

示例2: OnDistinctOrderYearsLoaded

		private void OnDistinctOrderYearsLoaded(LoadOperation<Year> loadOperation)
		{
			if (loadOperation.HasError)
			{
				loadOperation.MarkErrorAsHandled();
				return;
			}

			IList<int> distinctOrderYears = new List<int>();
			foreach (Year year in loadOperation.Entities)
			{
				distinctOrderYears.Add(year.ID);
			}

			this.ordYearComboBox.ItemsSource = distinctOrderYears;
			this.ordYearComboBox.SelectedIndex = 0;
			this.distinctOrderYearsLoaded = true;
		}
开发者ID:netintellect,项目名称:PluralsightSpaJumpStartFinal,代码行数:18,代码来源:Example.xaml.cs

示例3: GetSIPProvidersCompleted

        private void GetSIPProvidersCompleted(LoadOperation<SIPProvider> lo)
        {
            if (lo.HasError)
            {
                LogActivityMessage_External(MessageLevelsEnum.Error, "There was an error loading the SIP Providers. " + lo.Error.Message);
                lo.MarkErrorAsHandled();
            }
            else
            {
                m_sipProvidersPanel.AssetListTotal = lo.TotalEntityCount;
                m_sipProvidersPanel.SetAssetListSource(m_riaContext.SIPProviders);
                //LogActivityMessage_External(MessageLevelsEnum.Info, "SIP Provders successfully loaded, total " + lo.TotalEntityCount + " " + DateTime.Now.ToString("dd MMM yyyy HH:mm:ss") + ".");
            }

            m_sipProvidersPanelRefreshInProgress = false;
        }
开发者ID:sipsorcery,项目名称:sipsorcery,代码行数:16,代码来源:SIPProviderManager.xaml.cs

示例4: GetSIPProviderBindingsCompleted

        private void GetSIPProviderBindingsCompleted(LoadOperation<SIPProviderBinding> lo)
        {
            if (lo.HasError)
            {
                LogActivityMessage_External(MessageLevelsEnum.Error, "There was an error retrieving SIP provider bindings. " + lo.Error.Message);
                lo.MarkErrorAsHandled();
            }
            else
            {
                m_sipProviderRegistrationsPanel.AssetListTotal = lo.TotalEntityCount;
                m_sipProviderRegistrationsPanel.SetAssetListSource(m_riaContext.SIPProviderBindings);
                LogActivityMessage_External(MessageLevelsEnum.Info, lo.TotalEntityCount + " SIP provider bindings are registered.");
            }

            m_sipRegistrationAgentBindingsPanelRefreshInProgress = false;
        }
开发者ID:sipsorcery,项目名称:sipsorcery,代码行数:16,代码来源:SIPProviderManager.xaml.cs

示例5: LoadCompleted

        private void LoadCompleted(LoadOperation<Apartment> loadop)
        {
            if (loadop.HasError)
            {
                loadop.MarkErrorAsHandled();
            }
            else
            {
                if (!_bCancelLoadResult)
                {
                    //初始化从服务器查询的数据
                    //注意,该数据可能是已经存在的数据,或者新数据
                    //如果是已经存在的数据,保持不变
                    //新数据,如果没有Consumer,需要附加上Consumer以便后面的绑定显示等
                    foreach (Apartment apt in loadop.Entities)
                    {
                        //如果锁定状态为null,证明数据错误,必须丢弃
                        if (apt.LockStatu == null)
                        {
                            return;
                        }

                        apt.RefreshAuthenticate(false);

                        InitialAttachedData(apt);
                    }

                    MergeQueryAndBusingToLocked(loadop.Entities);
                }
                _bCancelLoadResult = false;
            }
        }
开发者ID:Attention,项目名称:NitpickHouse,代码行数:32,代码来源:ApartmentService.cs

示例6: SpeedDialsLoaded

        private void SpeedDialsLoaded(LoadOperation lo)
        {
            if (lo.HasError)
            {
                LogActivityMessage_External(MessageLevelsEnum.Error, "Error loading Speed Dials. " + lo.Error.Message);
                lo.MarkErrorAsHandled();
            }
            else
            {
                m_speedDialsPanel.AssetListTotal = lo.TotalEntityCount;
                m_speedDialsPanel.SetAssetListSource(m_riaContext.SIPDialplanLookups);
                m_speedDialsDataForm.ItemsSource = m_riaContext.SIPDialplanLookups;
            }

            m_gridReady = true;
            m_speedDialsPanelRefreshInProgress = false;
        }
开发者ID:sipsorcery,项目名称:sipsorcery,代码行数:17,代码来源:DialPlanWizard.xaml.cs

示例7: OnLoadCarsCompleted

        private void OnLoadCarsCompleted(LoadOperation<Car> op)
        {
            this.IsGridEnabled = true;

            if (op.HasError)
            {
                // TODO: handle errors
                var error = op.Error;
                throw error;

                op.MarkErrorAsHandled();
            }
            else if (!op.IsCanceled)
            {
                this._source.Source = op.Entities;

                if (op.TotalEntityCount != -1)
                {
                    this.CollectionView.SetTotalItemCount(op.TotalEntityCount);
                }
            }

            if (_source.Count >= 0)
            {
                CollectionView.MoveCurrentToFirst();
            }
        }
开发者ID:tbmihailov,项目名称:fueltracker-sl-sample,代码行数:27,代码来源:CarsListViewModel.cs

示例8: LoadCompleted

 private void LoadCompleted(LoadOperation<StatisticsConsumerView> loadop)
 {
     if (loadop.HasError)
     {
         System.Windows.MessageBox.Show(loadop.Error.ToString(), "加载数据错误", System.Windows.MessageBoxButton.OK);
         ((NitpickHouseStatistics.Controls.BusyIndicator)Application.Current.RootVisual).IsBusy = false;
         loadop.MarkErrorAsHandled();
     }
     else
     {
         data = loadop.Entities;
         ((NitpickHouseStatistics.Controls.BusyIndicator)Application.Current.RootVisual).IsBusy = false;
     }
 }
开发者ID:Attention,项目名称:NitpickHouse,代码行数:14,代码来源:StatisticsByHome.xaml.cs

示例9: OptionsLoaded

        private void OptionsLoaded(LoadOperation lo)
        {
            if (lo.HasError)
            {
                LogActivityMessage_External(MessageLevelsEnum.Error, "Error loading dial plan options. " + lo.Error.Message);
                lo.MarkErrorAsHandled();
            }
            else
            {
                m_optionsDataForm.ItemsSource = m_riaContext.SIPDialplanOptions;
            }

            m_optionsRefreshInProgress = false;
        }
开发者ID:sipsorcery,项目名称:sipsorcery,代码行数:14,代码来源:DialPlanWizard.xaml.cs

示例10: LoginComplete

 private void LoginComplete(LoadOperation op)
 {
     if (op.HasError)
     {
         // Remove the error information the RIA domain services framework adds in and that will just confuse things.
         string errorMessage = Regex.Replace(op.Error.Message, @"Load operation failed .*?\.", "");
         WriteLoginMessage("Error logging in." + errorMessage);
         op.MarkErrorAsHandled();
         UIHelper.SetText(m_passwordTextBox, String.Empty);
     }
     else if (op.Entities.Count() == 0)
     {
         WriteLoginMessage("Login failed.");
         UIHelper.SetText(m_passwordTextBox, String.Empty);
     }
     else
     {
         var user = op.Entities.SingleOrDefault() as User;
         Authenticated(user.Name, null);
         //Authenticated(m_loginUsername, null);
     }
 }
开发者ID:sipsorcery,项目名称:sipsorcery,代码行数:22,代码来源:LoginControl.xaml.cs

示例11: OnDistinctContactTitlesLoaded

		private void OnDistinctContactTitlesLoaded(LoadOperation<DistinctValue> loadOperation)
		{
			if (loadOperation.HasError)
			{
				loadOperation.MarkErrorAsHandled();
				return;
			}

			foreach (DistinctValue dv in loadOperation.Entities.ToList())
			{
				this.contactTitles.Add(dv.Value);
			}
		}
开发者ID:netintellect,项目名称:PluralsightSpaJumpStartFinal,代码行数:13,代码来源:CustomersViewModel.cs

示例12: LogoutComplete

        private void LogoutComplete(LoadOperation op)
        {
            if (op.HasError)
            {
                op.MarkErrorAsHandled();
            }

            CreateDomainContext();

            ThreadPool.QueueUserWorkItem(delegate { Initialise(); });
        }
开发者ID:sipsorcery,项目名称:sipsorcery,代码行数:11,代码来源:Page.xaml.cs

示例13: Operation_MarkAsHandled

        public void Operation_MarkAsHandled()
        {
            TestDataContext ctxt = new TestDataContext(new Uri(TestURIs.RootURI, "TestDomainServices-TestCatalog1.svc"));

            var query = ctxt.CreateQuery<Product>("ThrowGeneralException", null, false, true);
            LoadOperation lo = new LoadOperation<Product>(query, LoadBehavior.KeepCurrent, null, null, null);

            EventHandler action = (o, e) =>
            {
                LoadOperation loadOperation = (LoadOperation)o;
                if (loadOperation.HasError)
                {
                    loadOperation.MarkErrorAsHandled();
                }
            };
            lo.Completed += action;

            DomainOperationException ex = new DomainOperationException("Operation Failed!", OperationErrorStatus.ServerError, 42, "StackTrace");
            lo.Complete(ex);

            // verify that calling MarkAsHandled again is a noop
            lo.MarkErrorAsHandled();
            lo.MarkErrorAsHandled();

            // verify that calling MarkAsHandled on an operation not in error
            // results in an exception
            lo = new LoadOperation<Product>(query, LoadBehavior.KeepCurrent, null, null, null);
            Assert.IsFalse(lo.HasError);
            Assert.IsTrue(lo.IsErrorHandled);
            ExceptionHelper.ExpectInvalidOperationException(delegate
            {
                lo.MarkErrorAsHandled();
            }, Resource.Operation_HasErrorMustBeTrue);
        }
开发者ID:OpenRIAServices,项目名称:OpenRiaServices,代码行数:34,代码来源:OperationTests.cs

示例14: OnLoadPointsCompleted

        public void OnLoadPointsCompleted(LoadOperation<Point> op)
        {
            this.IsGridEnabled = true;
            if (op.HasError)
            {
                // TODO: handle errors
                op.MarkErrorAsHandled();
            }
            else if (!op.IsCanceled)
            {
                this.source.Source = op.Entities;

                if (op.TotalEntityCount != -1)
                {
                    this.view.SetTotalItemCount(op.TotalEntityCount);
                }
            }
            if (source.Count >= 0)
            {
                View.MoveCurrentToFirst();
            }
        }
开发者ID:tbmihailov,项目名称:fishing-point-sl,代码行数:22,代码来源:MapViewModel.cs

示例15: GetCustomerCompleted

        private void GetCustomerCompleted(LoadOperation<Customer> lo)
        {
            if (lo.HasError)
            {
                UIHelper.SetText(m_statusTextBlock, lo.Error.Message);
                lo.MarkErrorAsHandled();
            }
            else
            {
                m_customer = m_riaContext.Customers.FirstOrDefault();

                if (m_customer == null)
                {
                    UIHelper.SetText(m_statusTextBlock, "There was an error retrieving your details. Please re-login and try again.");
                }
                else
                {
                    this.DataContext = m_customer;
                    UIHelper.SetText(m_statusTextBlock, "Details successfully loaded.");
                    SetUpdateButtonsEnabled(true);
                }
            }
        }
开发者ID:sipsorcery,项目名称:sipsorcery,代码行数:23,代码来源:CustomerSettingsControl.xaml.cs


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