Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Controls / ValidationError.cs / 1 / 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
- CompatibleComparer.cs
- DragEvent.cs
- HierarchicalDataBoundControlAdapter.cs
- EventLogEntry.cs
- FtpRequestCacheValidator.cs
- WebPartVerb.cs
- BindingsCollection.cs
- DataServiceException.cs
- ComponentManagerBroker.cs
- CompilationSection.cs
- DelegateCompletionCallbackWrapper.cs
- AjaxFrameworkAssemblyAttribute.cs
- Thread.cs
- RelationshipSet.cs
- MenuItemStyleCollection.cs
- ListChangedEventArgs.cs
- _emptywebproxy.cs
- _TimerThread.cs
- BulletedList.cs
- DiscoveryServerProtocol.cs
- SizeAnimationBase.cs
- BitmapImage.cs
- TextEffect.cs
- XmlDictionaryString.cs
- EtwTrackingParticipant.cs
- GradientBrush.cs
- PeerContact.cs
- IteratorDescriptor.cs
- MessagePropertyDescription.cs
- WebPartConnectionsCloseVerb.cs
- Rijndael.cs
- BidPrivateBase.cs
- Dynamic.cs
- UTF32Encoding.cs
- ProfileSettingsCollection.cs
- BaseTreeIterator.cs
- RoutedEventHandlerInfo.cs
- SqlUDTStorage.cs
- SchemaElementLookUpTable.cs
- HttpInputStream.cs
- SerializerDescriptor.cs
- ConfigLoader.cs
- ObjectSet.cs
- LocalizableAttribute.cs
- JsonFormatReaderGenerator.cs
- UnsafeNativeMethods.cs
- ServiceManagerHandle.cs
- FontFamily.cs
- DESCryptoServiceProvider.cs
- InvalidateEvent.cs
- IProvider.cs
- TextBounds.cs
- EmissiveMaterial.cs
- CompositeActivityMarkupSerializer.cs
- ModelUtilities.cs
- latinshape.cs
- PingReply.cs
- ServicePointManagerElement.cs
- ReflectionUtil.cs
- InheritanceRules.cs
- CfgArc.cs
- CompositeFontParser.cs
- MinimizableAttributeTypeConverter.cs
- IsolatedStorageFile.cs
- SecurityDescriptor.cs
- ProfileService.cs
- Primitive.cs
- EventEntry.cs
- QueueException.cs
- TextHidden.cs
- HtmlTextViewAdapter.cs
- LoadWorkflowAsyncResult.cs
- XPathConvert.cs
- HtmlFormWrapper.cs
- WizardStepBase.cs
- Predicate.cs
- RepeaterItemCollection.cs
- PropertyCollection.cs
- CompareValidator.cs
- Panel.cs
- SymbolEqualComparer.cs
- ContainerUtilities.cs
- StringConverter.cs
- UidPropertyAttribute.cs
- WCFServiceClientProxyGenerator.cs
- XmlNodeWriter.cs
- TypeConverter.cs
- GZipStream.cs
- SspiSecurityToken.cs
- ValidationContext.cs
- PropertyPathConverter.cs
- OperatorExpressions.cs
- CodeTypeParameterCollection.cs
- UrlAuthorizationModule.cs
- ExpandoObject.cs
- OSEnvironmentHelper.cs
- StandardCommands.cs
- ButtonBase.cs
- VisualStyleTypesAndProperties.cs
- TimeSpanStorage.cs