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
- RTTypeWrapper.cs
- DataGridState.cs
- FormatterConverter.cs
- HttpListenerContext.cs
- SqlError.cs
- Compiler.cs
- NavigationWindowAutomationPeer.cs
- XmlLinkedNode.cs
- SystemIPInterfaceStatistics.cs
- ProcessStartInfo.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- IPipelineRuntime.cs
- DesignColumnCollection.cs
- ExtensionFile.cs
- DataGridViewLayoutData.cs
- PngBitmapEncoder.cs
- DataGridPageChangedEventArgs.cs
- EntityDataSourceValidationException.cs
- XmlBinaryReaderSession.cs
- AdapterDictionary.cs
- Connector.xaml.cs
- WindowInteractionStateTracker.cs
- AssociatedControlConverter.cs
- Timer.cs
- VerificationException.cs
- PropertyOverridesDialog.cs
- XmlRawWriter.cs
- Button.cs
- _ContextAwareResult.cs
- UserPersonalizationStateInfo.cs
- ColorContext.cs
- RectangleHotSpot.cs
- WebPermission.cs
- ConnectionManagementElementCollection.cs
- DataGridViewRowHeaderCell.cs
- SafeEventLogWriteHandle.cs
- SwitchLevelAttribute.cs
- DataObject.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- DataFieldConverter.cs
- NumberEdit.cs
- RefExpr.cs
- IDispatchConstantAttribute.cs
- EncodingTable.cs
- HostSecurityManager.cs
- ExpressionBuilder.cs
- CompositeFontInfo.cs
- EncodingInfo.cs
- WebPartCancelEventArgs.cs
- TypeConstant.cs
- MultipartIdentifier.cs
- AutomationEvent.cs
- GridViewEditEventArgs.cs
- PowerModeChangedEventArgs.cs
- ImageSourceValueSerializer.cs
- ParameterCollection.cs
- EpmContentDeSerializer.cs
- FastPropertyAccessor.cs
- AlternationConverter.cs
- HttpRequestCacheValidator.cs
- NCryptSafeHandles.cs
- ReadWriteSpinLock.cs
- FrameworkElement.cs
- AssemblySettingAttributes.cs
- SendMessageChannelCache.cs
- _Events.cs
- JournalEntryStack.cs
- BuilderPropertyEntry.cs
- DesignerCatalogPartChrome.cs
- ShapingWorkspace.cs
- WarningException.cs
- FormatSettings.cs
- SymLanguageVendor.cs
- Array.cs
- XamlStyleSerializer.cs
- PkcsMisc.cs
- DataSourceCacheDurationConverter.cs
- Attribute.cs
- DataTemplate.cs
- SendingRequestEventArgs.cs
- EncoderReplacementFallback.cs
- WebPartEventArgs.cs
- StateDesigner.LayoutSelectionGlyph.cs
- GridSplitter.cs
- ExpanderAutomationPeer.cs
- ISFTagAndGuidCache.cs
- SqlDataSourceQueryConverter.cs
- FormatVersion.cs
- LinkClickEvent.cs
- DaylightTime.cs
- COM2AboutBoxPropertyDescriptor.cs
- UrlAuthFailedErrorFormatter.cs
- ComponentCollection.cs
- WebBrowsableAttribute.cs
- ValidationSettings.cs
- EmptyEnumerator.cs
- ProcessManager.cs
- HttpApplicationStateBase.cs
- DataObject.cs
- StatusBarDrawItemEvent.cs