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
- HttpHandlerActionCollection.cs
- WeakReferenceKey.cs
- ComponentFactoryHelpers.cs
- SplineKeyFrames.cs
- RoleService.cs
- WindowsStartMenu.cs
- FilterableData.cs
- Missing.cs
- MappingException.cs
- MultiSelectRootGridEntry.cs
- StringArrayEditor.cs
- ConfigXmlAttribute.cs
- EllipticalNodeOperations.cs
- CanExecuteRoutedEventArgs.cs
- Rect.cs
- AnonymousIdentificationSection.cs
- ParseNumbers.cs
- SmtpFailedRecipientException.cs
- ChannelCredentials.cs
- DispatcherExceptionEventArgs.cs
- MetricEntry.cs
- FormsAuthenticationUserCollection.cs
- StrongNameSignatureInformation.cs
- MimeBasePart.cs
- Bitmap.cs
- StatusBarItem.cs
- ConfigXmlReader.cs
- SliderAutomationPeer.cs
- _ProxyChain.cs
- MethodBody.cs
- SpecialNameAttribute.cs
- SharedPersonalizationStateInfo.cs
- EntityContainer.cs
- Rules.cs
- DesignerProperties.cs
- NavigatorOutput.cs
- ContentFileHelper.cs
- LayoutExceptionEventArgs.cs
- GroupStyle.cs
- DataGridViewColumnTypeEditor.cs
- TemplateBindingExtension.cs
- LinkedResource.cs
- SqlDataSourceFilteringEventArgs.cs
- StringReader.cs
- EdmItemError.cs
- XmlQueryCardinality.cs
- Transform3DCollection.cs
- XmlHierarchyData.cs
- FileDialogCustomPlace.cs
- HtmlTable.cs
- formatter.cs
- FlowDocument.cs
- RowSpanVector.cs
- RowUpdatedEventArgs.cs
- CallbackHandler.cs
- BindingsCollection.cs
- XmlSchemaAnnotated.cs
- ConfigXmlDocument.cs
- TimeoutValidationAttribute.cs
- XmlCDATASection.cs
- BooleanFunctions.cs
- fixedPageContentExtractor.cs
- ToolStripRenderEventArgs.cs
- RemotingService.cs
- IsolatedStorageFile.cs
- HtmlInputButton.cs
- Wildcard.cs
- UnsafeNativeMethods.cs
- XPathNodeHelper.cs
- WebBrowser.cs
- Misc.cs
- WebBrowserSiteBase.cs
- XmlImplementation.cs
- RuleSetDialog.Designer.cs
- CorePropertiesFilter.cs
- OleServicesContext.cs
- NotSupportedException.cs
- HMACSHA256.cs
- PathGeometry.cs
- OleDbError.cs
- NullRuntimeConfig.cs
- TransportContext.cs
- GridViewHeaderRowPresenter.cs
- CrossAppDomainChannel.cs
- HierarchicalDataSourceConverter.cs
- SelectingProviderEventArgs.cs
- PerformanceCounterPermissionEntry.cs
- XmlSchemaComplexContentExtension.cs
- SafeMarshalContext.cs
- DesignTimeVisibleAttribute.cs
- EventLogPermission.cs
- DataRelationPropertyDescriptor.cs
- DropSource.cs
- GenericTypeParameterBuilder.cs
- EventProvider.cs
- XComponentModel.cs
- XmlQueryContext.cs
- SerializerWriterEventHandlers.cs
- ThemeDirectoryCompiler.cs
- PtsContext.cs