當前位置: 首頁>>代碼示例>>C#>>正文


C# Controls.ValidationErrorEventArgs類代碼示例

本文整理匯總了C#中System.Windows.Controls.ValidationErrorEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# ValidationErrorEventArgs類的具體用法?C# ValidationErrorEventArgs怎麽用?C# ValidationErrorEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ValidationErrorEventArgs類屬於System.Windows.Controls命名空間,在下文中一共展示了ValidationErrorEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: PhoneApplicationPage_BindingValidationError

 private void PhoneApplicationPage_BindingValidationError(object sender, ValidationErrorEventArgs e)
 {
     if (e.Action == ValidationErrorEventAction.Added)
     {
         MessageBox.Show(e.Error.Exception.Message, "Error", MessageBoxButton.OK);
     }
 }
開發者ID:gibratim,項目名稱:converter,代碼行數:7,代碼來源:MainPage.xaml.cs

示例2: OnValidationError

 /// <summary>
 /// プレゼン用 テキストボックスのバリデーションエラーを捕まえることができる
 /// </summary>
 /// <param name="sender">送信オブジェクト</param>
 /// <param name="e">バリデーションエラーに関するパラメータ</param>
 private void OnValidationError(object sender, ValidationErrorEventArgs e)
 {
     if (e.Action == ValidationErrorEventAction.Added)
     {
         // バリデーションエラーが発生したときの処理を追加できます
     }
 }
開發者ID:ryudo,項目名稱:TextBoxValidationTutorial,代碼行數:12,代碼來源:MainWindow.xaml.cs

示例3: ValidationError

 private void ValidationError(object sender, ValidationErrorEventArgs e)
 {
     if (e.Action == ValidationErrorEventAction.Added)
     {
         MessageBox.Show(e.Error.ErrorContent.ToString());
     }
 }
開發者ID:FruityBrew,項目名稱:SpaceDoctor,代碼行數:7,代碼來源:MainWindow.xaml.cs

示例4: UIStaff_BindingValidationError

 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void UIStaff_BindingValidationError(object sender, ValidationErrorEventArgs e)
 {
     if (e.Action == ValidationErrorEventAction.Added)
         hasError = true;
     else if (e.Action == ValidationErrorEventAction.Removed)
         hasError = false;
 }
開發者ID:sajidk,項目名稱:Estimate-SL,代碼行數:12,代碼來源:UIStaff.xaml.cs

示例5: EntityValidationError

 public void EntityValidationError(object sender, ValidationErrorEventArgs e)
 {
     if (e.Action == ValidationErrorEventAction.Added)
         EntityErrorCount++;
     else if (EntityErrorCount > 0)
         EntityErrorCount--;
 }
開發者ID:kstuDss,項目名稱:DecisionSupportSystem,代碼行數:7,代碼來源:ErrorCatcher.cs

示例6: Validation_Error

 private void Validation_Error(object sender, ValidationErrorEventArgs e)
 {
     if (e.Action == ValidationErrorEventAction.Added)
         _errors++;
     else
         _errors--;
 }
開發者ID:taksun,項目名稱:WPF,代碼行數:7,代碼來源:dane_klienta.xaml.cs

示例7: grdConfig_ValidationError

 private void grdConfig_ValidationError(object sender, ValidationErrorEventArgs e) {
     if (e.Action == ValidationErrorEventAction.Added)
         _validationErrors.Add(e.Error);
     else
         _validationErrors.Remove(e.Error);
     btSave.IsEnabled = _validationErrors.Count == 0;
 }
開發者ID:beebopfr,項目名稱:srtg,代碼行數:7,代碼來源:SettingsWindow.xaml.cs

示例8: Validation_Error

 private void Validation_Error(object sender, ValidationErrorEventArgs e)
 {
     if (e.Action == ValidationErrorEventAction.Added)
         _noOfErrorsOnScreen++;
     else
         _noOfErrorsOnScreen--;
 }
開發者ID:wolverine169,項目名稱:BikeWareHouse,代碼行數:7,代碼來源:AddUserWindow.xaml.cs

示例9: CheckEntityListError

 public static void CheckEntityListError(ValidationErrorEventArgs e)
 {
     if (e.Action == ValidationErrorEventAction.Added)
         EntityListErrorCount++;
     else if (EntityListErrorCount > 0)
         EntityListErrorCount--;
 }
開發者ID:kstuDss,項目名稱:DecisionSupportSystem,代碼行數:7,代碼來源:ErrorCount.cs

示例10: validationError

    /// <summary>
    /// 使用數據驗證後,對數據進行驗證
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="args"></param>
    private static void validationError(object sender, ValidationErrorEventArgs args)
    {
        if ((sender as FrameworkElement).DataContext != null && (sender as FrameworkElement).DataContext as IDataValidationInfo != null)
            {
                IDataValidationInfo dataValition = (sender as FrameworkElement).DataContext as IDataValidationInfo;

                bool isSuccess = (bool)((args.OriginalSource as FrameworkElement).GetValue(Validation.HasErrorProperty));

                Binding bind = ((System.Windows.Data.BindingExpression)((System.Windows.Controls.ValidationError)args.Error).BindingInError).ParentBinding;
                if (bind != null)
                {
                    string propetyName;
                    if (bind.Source != null)
                    {
                        propetyName = bind.Path.Path + "@" + bind.Source.GetHashCode();
                    }
                    else
                    {
                        propetyName = bind.Path.Path + "@" + (sender as FrameworkElement).DataContext.GetHashCode();
                    }

                    if (isSuccess && args.Action == ValidationErrorEventAction.Added)
                    {
                        dataValition.Added(propetyName, args.Error.ErrorContent);
                    }
                    else if (!isSuccess && args.Action == ValidationErrorEventAction.Removed)
                    {
                        dataValition.Removed(propetyName);
                    }
                }
            }
    }
開發者ID:wangjianglin,項目名稱:dotnet-core,代碼行數:37,代碼來源:Validations.cs

示例11: ControlsPanel_BindingValidationError

 /// <summary>
 /// Shows the errors in a message box if any
 /// </summary>
 private void ControlsPanel_BindingValidationError(object sender, ValidationErrorEventArgs e)
 {
     if (e.Action == ValidationErrorEventAction.Added)
     {
         hasErrors = true;
         MessageBox.Show(e.Error.ErrorContent.ToString());
     }
 }
開發者ID:Nithanaroy,項目名稱:medicines-catalogue,代碼行數:11,代碼來源:Settings.xaml.cs

示例12: Validation_Error

		private void Validation_Error(object sender, ValidationErrorEventArgs e)
		{
			if (e.Action == ValidationErrorEventAction.Added)
				errorCount++;
			if (e.Action == ValidationErrorEventAction.Removed)
				errorCount--;

			if (this.ok != null)
				this.ok.IsEnabled = (errorCount == 0);
		}
開發者ID:hungdluit,項目名稱:sipserver,代碼行數:10,代碼來源:OkEnabler.cs

示例13: SurNameTextBox_Error

 private void SurNameTextBox_Error(object sender, ValidationErrorEventArgs e)
 {
     if (e.Action == ValidationErrorEventAction.Added)
     {
         System.Console.Beep();
         MessageBox.Show(e.Error.ErrorContent.ToString());
     }
     else
         System.Diagnostics.Trace.WriteLine("Validation error cleared");
 }
開發者ID:KutsyndaPavlo,項目名稱:Exam_70-511_Test_samples,代碼行數:10,代碼來源:DataGridExampleView.xaml.cs

示例14: txt_Error

 private void txt_Error(object sender, ValidationErrorEventArgs e)
 {
     if (e.Action == ValidationErrorEventAction.Added)
     {
         ((Control)sender).ToolTip = e.Error.ErrorContent.ToString();
     }
     else
     {
         ((Control)sender).ToolTip = "";
     }
 }
開發者ID:mwolfaardt,項目名稱:bulkimagechanger,代碼行數:11,代碼來源:CrmAuthenticationView.xaml.cs

示例15: Element_ValidationError

 private void Element_ValidationError(object sender, ValidationErrorEventArgs e)
 {
     if (e.Action == ValidationErrorEventAction.Added && !_errorMessages.Contains(e.Error.ErrorContent.ToString()))
     {
     _errorMessages.Add(e.Error.ErrorContent.ToString());
     }
     else if (e.Action == ValidationErrorEventAction.Removed && _errorMessages.Contains(e.Error.ErrorContent.ToString()))
     {
     _errorMessages.Remove(e.Error.ErrorContent.ToString());
     }
 }
開發者ID:smallcube,項目名稱:EHealthCarePatientApp,代碼行數:11,代碼來源:ValidationSummary.xaml.cs


注:本文中的System.Windows.Controls.ValidationErrorEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。