Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / MS / Internal / Data / BindingWorker.cs / 1 / BindingWorker.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: Defines BindingWorker base class. // //--------------------------------------------------------------------------- using System; using System.Reflection; using System.ComponentModel; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Threading; namespace MS.Internal.Data { // Base class for binding workers. // Derived classes implement binding functionality depending on the // type of source, e.g. ClrBindingWorker, XmlBindingWorker internal abstract class BindingWorker { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- protected BindingWorker(BindingExpression b) { _bindingExpression = b; } //------------------------------------------------------ // // Internal properties - used by parent BindingExpression // //----------------------------------------------------- internal virtual Type SourcePropertyType { get { return null; } } internal virtual bool CanUpdate { get { return false; } } internal BindingExpression ParentBindingExpression { get { return _bindingExpression; } } internal Type TargetPropertyType { get { return TargetProperty.PropertyType; } } internal virtual bool IsDBNullValidForUpdate { get { return false; } } internal virtual object SourceItem { get { return null; } } internal virtual string SourcePropertyName { get { return null; } } //------------------------------------------------------ // // Internal methods - used by parent BindingExpression // //------------------------------------------------------ internal virtual void AttachDataItem() {} internal virtual void DetachDataItem() {} internal virtual void OnCurrentChanged(ICollectionView collectionView, EventArgs args) {} internal virtual object RawValue() { return null; } internal virtual void UpdateValue(object value) {} internal virtual void RefreshValue() {} internal virtual bool UsesDependencyProperty(DependencyObject d, DependencyProperty dp) { return false; } internal virtual void OnSourceInvalidation(DependencyObject d, DependencyProperty dp, bool isASubPropertyChange) {} internal virtual ValidationError ValidateDataError(BindingExpressionBase bindingExpressionBase) { return null; } //----------------------------------------------------- // // Protected Properties // //------------------------------------------------------ protected Binding ParentBinding { get { return ParentBindingExpression.ParentBinding; } } protected bool IsDynamic { get { return ParentBindingExpression.IsDynamic; } } internal bool IsReflective { get { return ParentBindingExpression.IsReflective; } } protected bool IgnoreSourcePropertyChange { get { return ParentBindingExpression.IgnoreSourcePropertyChange; } } protected object DataItem { get { return ParentBindingExpression.DataItem; } } protected DependencyObject TargetElement { get { return ParentBindingExpression.TargetElement; } } protected DependencyProperty TargetProperty { get { return ParentBindingExpression.TargetProperty; } } protected DataBindEngine Engine { get { return ParentBindingExpression.Engine; } } protected Dispatcher Dispatcher { get { return ParentBindingExpression.Dispatcher; } } protected BindingStatus Status { get { return ParentBindingExpression.Status; } set { ParentBindingExpression.SetStatus(value); } } //----------------------------------------------------- // // Protected Methods // //----------------------------------------------------- protected void SetTransferIsPending(bool value) { ParentBindingExpression.IsTransferPending = value; } //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ BindingExpression _bindingExpression; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: Defines BindingWorker base class. // //--------------------------------------------------------------------------- using System; using System.Reflection; using System.ComponentModel; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Threading; namespace MS.Internal.Data { // Base class for binding workers. // Derived classes implement binding functionality depending on the // type of source, e.g. ClrBindingWorker, XmlBindingWorker internal abstract class BindingWorker { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- protected BindingWorker(BindingExpression b) { _bindingExpression = b; } //------------------------------------------------------ // // Internal properties - used by parent BindingExpression // //----------------------------------------------------- internal virtual Type SourcePropertyType { get { return null; } } internal virtual bool CanUpdate { get { return false; } } internal BindingExpression ParentBindingExpression { get { return _bindingExpression; } } internal Type TargetPropertyType { get { return TargetProperty.PropertyType; } } internal virtual bool IsDBNullValidForUpdate { get { return false; } } internal virtual object SourceItem { get { return null; } } internal virtual string SourcePropertyName { get { return null; } } //------------------------------------------------------ // // Internal methods - used by parent BindingExpression // //------------------------------------------------------ internal virtual void AttachDataItem() {} internal virtual void DetachDataItem() {} internal virtual void OnCurrentChanged(ICollectionView collectionView, EventArgs args) {} internal virtual object RawValue() { return null; } internal virtual void UpdateValue(object value) {} internal virtual void RefreshValue() {} internal virtual bool UsesDependencyProperty(DependencyObject d, DependencyProperty dp) { return false; } internal virtual void OnSourceInvalidation(DependencyObject d, DependencyProperty dp, bool isASubPropertyChange) {} internal virtual ValidationError ValidateDataError(BindingExpressionBase bindingExpressionBase) { return null; } //----------------------------------------------------- // // Protected Properties // //------------------------------------------------------ protected Binding ParentBinding { get { return ParentBindingExpression.ParentBinding; } } protected bool IsDynamic { get { return ParentBindingExpression.IsDynamic; } } internal bool IsReflective { get { return ParentBindingExpression.IsReflective; } } protected bool IgnoreSourcePropertyChange { get { return ParentBindingExpression.IgnoreSourcePropertyChange; } } protected object DataItem { get { return ParentBindingExpression.DataItem; } } protected DependencyObject TargetElement { get { return ParentBindingExpression.TargetElement; } } protected DependencyProperty TargetProperty { get { return ParentBindingExpression.TargetProperty; } } protected DataBindEngine Engine { get { return ParentBindingExpression.Engine; } } protected Dispatcher Dispatcher { get { return ParentBindingExpression.Dispatcher; } } protected BindingStatus Status { get { return ParentBindingExpression.Status; } set { ParentBindingExpression.SetStatus(value); } } //----------------------------------------------------- // // Protected Methods // //----------------------------------------------------- protected void SetTransferIsPending(bool value) { ParentBindingExpression.IsTransferPending = value; } //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ BindingExpression _bindingExpression; } } // 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
- ToggleProviderWrapper.cs
- AsymmetricCryptoHandle.cs
- DebugViewWriter.cs
- ToolStripContainer.cs
- MetadataHelper.cs
- BordersPage.cs
- ButtonFlatAdapter.cs
- DiscoveryClientProtocol.cs
- MultiPropertyDescriptorGridEntry.cs
- LayoutSettings.cs
- ToolStripDropDownItem.cs
- CapacityStreamGeometryContext.cs
- SqlRowUpdatingEvent.cs
- ArgIterator.cs
- Nullable.cs
- DeviceSpecificChoiceCollection.cs
- CancellationHandler.cs
- EncodingInfo.cs
- MimeMapping.cs
- TableRowGroup.cs
- PageThemeCodeDomTreeGenerator.cs
- InfoCardTrace.cs
- DataException.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- SmtpFailedRecipientException.cs
- ProcessHostServerConfig.cs
- AnnotationService.cs
- TextEditorContextMenu.cs
- AddressAlreadyInUseException.cs
- XmlDocumentFieldSchema.cs
- XmlSchemaIdentityConstraint.cs
- SecurityBindingElementImporter.cs
- XmlSchemaDatatype.cs
- XmlDigitalSignatureProcessor.cs
- TypeHelper.cs
- IPAddressCollection.cs
- BoundsDrawingContextWalker.cs
- ProfessionalColorTable.cs
- StateManagedCollection.cs
- XmlnsDefinitionAttribute.cs
- WindowsToolbarAsMenu.cs
- WebPartConnectionsCloseVerb.cs
- ExpressionDumper.cs
- latinshape.cs
- XmlLanguage.cs
- XamlReader.cs
- DistinctQueryOperator.cs
- SubMenuStyle.cs
- LogReservationCollection.cs
- EarlyBoundInfo.cs
- WebRequestModuleElementCollection.cs
- FormViewPageEventArgs.cs
- QuadraticBezierSegment.cs
- StateRuntime.cs
- MemberExpressionHelper.cs
- SByte.cs
- ZeroOpNode.cs
- ResourcePool.cs
- ListViewItemMouseHoverEvent.cs
- TableParagraph.cs
- xml.cs
- ButtonPopupAdapter.cs
- WmlValidatorAdapter.cs
- PageClientProxyGenerator.cs
- TimeManager.cs
- _emptywebproxy.cs
- WrappingXamlSchemaContext.cs
- HMACSHA256.cs
- TransformGroup.cs
- IIS7UserPrincipal.cs
- StreamWriter.cs
- ConfigXmlComment.cs
- WindowsGraphics.cs
- XmlSchemaCollection.cs
- HtmlEmptyTagControlBuilder.cs
- ListViewInsertEventArgs.cs
- SingleTagSectionHandler.cs
- TraceHandler.cs
- MailMessage.cs
- DataGridViewColumn.cs
- EnumUnknown.cs
- RuntimeConfigurationRecord.cs
- EntitySqlQueryBuilder.cs
- DSACryptoServiceProvider.cs
- WebPartChrome.cs
- WebPartHeaderCloseVerb.cs
- Viewport3DVisual.cs
- ControlAdapter.cs
- XmlSchemaAnyAttribute.cs
- XmlSchemaAll.cs
- DataGridLinkButton.cs
- DesignSurfaceManager.cs
- MessageBox.cs
- BaseCollection.cs
- IndicCharClassifier.cs
- ResourcePermissionBaseEntry.cs
- KeyedPriorityQueue.cs
- SoapHeaderAttribute.cs
- DataGridSortCommandEventArgs.cs
- StringArrayEditor.cs