Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Controls / ValidationError.cs / 1305600 / ValidationError.cs
//---------------------------------------------------------------------------- // //// Copyright (C) 2003 by Microsoft Corporation. All rights reserved. // // // // Description: // An error in validation -- either created by an ValidationRule // or explicitly through MarkInvalid on BindingExpression or MultiBindingExpression. // // See specs at http://avalon/connecteddata/Specs/Validation.mht // // History: // 5/3/2004 mharper: created. // //--------------------------------------------------------------------------- using System; namespace System.Windows.Controls { ////// An error in validation -- either created by an ValidationRule /// or explicitly through MarkInvalid on BindingExpression or MultiBindingExpression. /// public class ValidationError { ////// ValidationError ctor /// /// rule that detected validation error /// BindingExpression for which validation failed /// validation rule specific details to the error /// exception that caused the validation failure; optional, can be null public ValidationError(ValidationRule ruleInError, object bindingInError, object errorContent, Exception exception) { if (ruleInError == null) throw new ArgumentNullException("ruleInError"); if (bindingInError == null) throw new ArgumentNullException("bindingInError"); _ruleInError = ruleInError; _bindingInError = bindingInError; _errorContent = errorContent; _exception = exception; } ////// ValidationError ctor /// rule that detected validation error /// BindingExpression for which validation failed /// public ValidationError(ValidationRule ruleInError, object bindingInError) : this(ruleInError, bindingInError, null, null) { } ////// If the validationError is as the result of an ValidationRule, /// then this is the reference to that ValidationRule. /// public ValidationRule RuleInError { get { return _ruleInError; } set { _ruleInError = value; } } ////// Some additional context for the ValidationError, such as /// a string describing the error. /// public object ErrorContent { get { return _errorContent; } set { _errorContent = value; } } ////// If the ValidationError is the result of some Exception, /// this will be a reference to that exception. /// public Exception Exception { get { return _exception; } set { _exception = value; } } ////// The BindingExpression or MultiBindingExpression that was marked invalid /// either explicitly, or while validating the ValidationRules collection. /// public object BindingInError { get { return _bindingInError; } } private ValidationRule _ruleInError; private object _errorContent; private Exception _exception; private object _bindingInError; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // //// Copyright (C) 2003 by Microsoft Corporation. All rights reserved. // // // // Description: // An error in validation -- either created by an ValidationRule // or explicitly through MarkInvalid on BindingExpression or MultiBindingExpression. // // See specs at http://avalon/connecteddata/Specs/Validation.mht // // History: // 5/3/2004 mharper: created. // //--------------------------------------------------------------------------- using System; namespace System.Windows.Controls { ////// An error in validation -- either created by an ValidationRule /// or explicitly through MarkInvalid on BindingExpression or MultiBindingExpression. /// public class ValidationError { ////// ValidationError ctor /// /// rule that detected validation error /// BindingExpression for which validation failed /// validation rule specific details to the error /// exception that caused the validation failure; optional, can be null public ValidationError(ValidationRule ruleInError, object bindingInError, object errorContent, Exception exception) { if (ruleInError == null) throw new ArgumentNullException("ruleInError"); if (bindingInError == null) throw new ArgumentNullException("bindingInError"); _ruleInError = ruleInError; _bindingInError = bindingInError; _errorContent = errorContent; _exception = exception; } ////// ValidationError ctor /// rule that detected validation error /// BindingExpression for which validation failed /// public ValidationError(ValidationRule ruleInError, object bindingInError) : this(ruleInError, bindingInError, null, null) { } ////// If the validationError is as the result of an ValidationRule, /// then this is the reference to that ValidationRule. /// public ValidationRule RuleInError { get { return _ruleInError; } set { _ruleInError = value; } } ////// Some additional context for the ValidationError, such as /// a string describing the error. /// public object ErrorContent { get { return _errorContent; } set { _errorContent = value; } } ////// If the ValidationError is the result of some Exception, /// this will be a reference to that exception. /// public Exception Exception { get { return _exception; } set { _exception = value; } } ////// The BindingExpression or MultiBindingExpression that was marked invalid /// either explicitly, or while validating the ValidationRules collection. /// public object BindingInError { get { return _bindingInError; } } private ValidationRule _ruleInError; private object _errorContent; private Exception _exception; private object _bindingInError; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MachineKeySection.cs
- TemporaryBitmapFile.cs
- XmlDigitalSignatureProcessor.cs
- OpenTypeLayoutCache.cs
- Rotation3DAnimation.cs
- CompositeFontFamily.cs
- DeferredElementTreeState.cs
- XmlNotation.cs
- ContentElement.cs
- MultipleFilterMatchesException.cs
- PathFigureCollection.cs
- IndexedString.cs
- PtsContext.cs
- TransformDescriptor.cs
- TrustExchangeException.cs
- TimeIntervalCollection.cs
- ToolStripControlHost.cs
- CodeArrayIndexerExpression.cs
- ScriptComponentDescriptor.cs
- EpmContentDeSerializerBase.cs
- GuidConverter.cs
- CacheVirtualItemsEvent.cs
- MethodCallConverter.cs
- NullableDecimalAverageAggregationOperator.cs
- DiscoveryRequestHandler.cs
- GetPageCompletedEventArgs.cs
- IconConverter.cs
- SqlDataAdapter.cs
- COM2TypeInfoProcessor.cs
- FixedHighlight.cs
- ProcessHostServerConfig.cs
- PathFigureCollection.cs
- StringOutput.cs
- CellIdBoolean.cs
- XmlDataContract.cs
- TableLayoutRowStyleCollection.cs
- FullTrustAssembly.cs
- DoubleStorage.cs
- VariableBinder.cs
- Timeline.cs
- BitSet.cs
- ContractsBCL.cs
- ProcessInputEventArgs.cs
- Pen.cs
- x509utils.cs
- WebConfigurationHost.cs
- DataControlCommands.cs
- TraceSection.cs
- BaseUriHelper.cs
- EditorPartCollection.cs
- XamlSerializationHelper.cs
- DurableServiceAttribute.cs
- SecurityState.cs
- XmlSchemaElement.cs
- SecurityTokenProvider.cs
- GroupBox.cs
- SimpleLine.cs
- TextRunCacheImp.cs
- DesignTimeType.cs
- ToolStripPanelRow.cs
- ComponentResourceManager.cs
- UInt64Converter.cs
- User.cs
- ErrorEventArgs.cs
- XamlToRtfParser.cs
- PtsPage.cs
- ErrorWrapper.cs
- StructuredProperty.cs
- ReflectionPermission.cs
- ContractMethodParameterInfo.cs
- MethodBuilderInstantiation.cs
- EdmComplexPropertyAttribute.cs
- ResourceDescriptionAttribute.cs
- DebugControllerThread.cs
- TextBox.cs
- MenuItemBinding.cs
- FontStyleConverter.cs
- WebPartChrome.cs
- VerificationAttribute.cs
- XhtmlBasicLinkAdapter.cs
- FormatterConverter.cs
- Message.cs
- DomNameTable.cs
- BaseTemplateCodeDomTreeGenerator.cs
- CodeParameterDeclarationExpression.cs
- DoubleLinkList.cs
- EqualityComparer.cs
- BmpBitmapDecoder.cs
- recordstatefactory.cs
- _SslStream.cs
- ListSourceHelper.cs
- Deflater.cs
- BitmapEffectRenderDataResource.cs
- WebPartCollection.cs
- TimeSpanConverter.cs
- DropShadowBitmapEffect.cs
- ContextStack.cs
- ServiceOperationParameter.cs
- WebPartVerb.cs
- UniqueEventHelper.cs