Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / MS / Internal / Data / BindingWorker.cs / 1305600 / 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; } internal virtual bool IsPathCurrent() { return true; } //----------------------------------------------------- // // 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; } internal virtual bool IsPathCurrent() { return true; } //----------------------------------------------------- // // 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
- remotingproxy.cs
- PersianCalendar.cs
- CodeStatement.cs
- DataServiceHost.cs
- PackWebResponse.cs
- AccessKeyManager.cs
- DecoderReplacementFallback.cs
- AutoGeneratedField.cs
- RawUIStateInputReport.cs
- SqlNode.cs
- TextViewBase.cs
- HwndSource.cs
- SamlConditions.cs
- PlatformNotSupportedException.cs
- OutOfProcStateClientManager.cs
- OdbcInfoMessageEvent.cs
- CodeNamespaceImportCollection.cs
- WindowsStatusBar.cs
- InvalidOperationException.cs
- ProcessManager.cs
- AttributeQuery.cs
- ButtonStandardAdapter.cs
- PathGradientBrush.cs
- MemberAccessException.cs
- mediaeventargs.cs
- EpmTargetPathSegment.cs
- _NtlmClient.cs
- PersianCalendar.cs
- SingleObjectCollection.cs
- documentsequencetextview.cs
- ScriptComponentDescriptor.cs
- EntityClientCacheKey.cs
- CharEntityEncoderFallback.cs
- SqlInfoMessageEvent.cs
- DbConnectionFactory.cs
- OracleConnectionStringBuilder.cs
- _NetworkingPerfCounters.cs
- Cursors.cs
- WebPartZone.cs
- LocatorBase.cs
- IgnoreSection.cs
- PartialCachingAttribute.cs
- NameSpaceEvent.cs
- IriParsingElement.cs
- CorrelationValidator.cs
- ArrayElementGridEntry.cs
- DefaultBindingPropertyAttribute.cs
- Transform.cs
- followingquery.cs
- EdmProviderManifest.cs
- SegmentInfo.cs
- DataExpression.cs
- BitSet.cs
- SR.cs
- SiteMapNodeCollection.cs
- CrossContextChannel.cs
- contentDescriptor.cs
- HostedImpersonationContext.cs
- SQlBooleanStorage.cs
- SessionStateModule.cs
- CacheModeValueSerializer.cs
- FileVersion.cs
- SqlBulkCopy.cs
- Rights.cs
- EndpointDiscoveryMetadata.cs
- TextDecorationCollectionConverter.cs
- CategoryGridEntry.cs
- VersionConverter.cs
- MergeFilterQuery.cs
- NonParentingControl.cs
- PageAdapter.cs
- CompatibleIComparer.cs
- CircleHotSpot.cs
- localization.cs
- ApplicationException.cs
- HtmlButton.cs
- OrderedEnumerableRowCollection.cs
- RequestContext.cs
- HtmlTableCellCollection.cs
- SwitchLevelAttribute.cs
- ModelPerspective.cs
- MouseButtonEventArgs.cs
- FunctionDescription.cs
- DataListItemCollection.cs
- List.cs
- OpenFileDialog.cs
- thaishape.cs
- WebPartAddingEventArgs.cs
- WrapperEqualityComparer.cs
- LocalizableAttribute.cs
- FormatConvertedBitmap.cs
- SpellerError.cs
- TerminatorSinks.cs
- JsonWriterDelegator.cs
- ConnectionAcceptor.cs
- ParseHttpDate.cs
- ExpressionDumper.cs
- TypeLoadException.cs
- While.cs
- SoapAttributes.cs