ConversionValidationRule.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Controls / ConversionValidationRule.cs / 1305600 / ConversionValidationRule.cs

                            //---------------------------------------------------------------------------- 
//
// 
//    Copyright (C) by Microsoft Corporation.  All rights reserved.
//  
//
// 
// Description: 
//      ConversionValidationRule is used when a ValidationError is the result of
//      conversion failure, as there is no actual ValidationRule. 
//
//---------------------------------------------------------------------------

 
using System;
using System.Windows; 
using System.Globalization; 
using System.Windows.Controls;
 
namespace System.Windows.Controls
{
    /// 
    ///     ConversionValidationRule is used when a ValidationError is the result of 
    ///     a conversion failure, as there is no actual ValidationRule.
    ///  
    internal sealed class ConversionValidationRule : ValidationRule 
    {
 
        /// 
        /// ConversionValidationRule ctor.
        /// 
        internal ConversionValidationRule() : base(ValidationStep.ConvertedProposedValue, false) 
        {
        } 
 
        /// 
        /// Validate is called when Data binding is updating 
        /// 
        public override ValidationResult Validate(object value, CultureInfo cultureInfo)
        {
            return ValidationResult.ValidResult; 
        }
 
        internal static readonly ConversionValidationRule Instance = new ConversionValidationRule(); 
    }
} 


// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//---------------------------------------------------------------------------- 
//
// 
//    Copyright (C) by Microsoft Corporation.  All rights reserved.
//  
//
// 
// Description: 
//      ConversionValidationRule is used when a ValidationError is the result of
//      conversion failure, as there is no actual ValidationRule. 
//
//---------------------------------------------------------------------------

 
using System;
using System.Windows; 
using System.Globalization; 
using System.Windows.Controls;
 
namespace System.Windows.Controls
{
    /// 
    ///     ConversionValidationRule is used when a ValidationError is the result of 
    ///     a conversion failure, as there is no actual ValidationRule.
    ///  
    internal sealed class ConversionValidationRule : ValidationRule 
    {
 
        /// 
        /// ConversionValidationRule ctor.
        /// 
        internal ConversionValidationRule() : base(ValidationStep.ConvertedProposedValue, false) 
        {
        } 
 
        /// 
        /// Validate is called when Data binding is updating 
        /// 
        public override ValidationResult Validate(object value, CultureInfo cultureInfo)
        {
            return ValidationResult.ValidResult; 
        }
 
        internal static readonly ConversionValidationRule Instance = new ConversionValidationRule(); 
    }
} 


// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.

                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK