Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- MulticastNotSupportedException.cs
- State.cs
- WebPartsPersonalizationAuthorization.cs
- UpdateExpressionVisitor.cs
- SqlDataSourceView.cs
- ApplicationSecurityManager.cs
- DropShadowBitmapEffect.cs
- ExceptionUtility.cs
- OleStrCAMarshaler.cs
- ToolStripRendererSwitcher.cs
- TransformConverter.cs
- NetTcpBindingCollectionElement.cs
- ViewgenGatekeeper.cs
- HighlightComponent.cs
- ActivitySurrogateSelector.cs
- StrokeCollectionConverter.cs
- CharEnumerator.cs
- RSAOAEPKeyExchangeDeformatter.cs
- EventArgs.cs
- Page.cs
- HttpDebugHandler.cs
- GroupDescription.cs
- InternalSafeNativeMethods.cs
- ParserHooks.cs
- SoapInteropTypes.cs
- CryptoProvider.cs
- FigureHelper.cs
- AncestorChangedEventArgs.cs
- CssStyleCollection.cs
- InputScopeNameConverter.cs
- OperationCanceledException.cs
- DataStorage.cs
- ButtonStandardAdapter.cs
- CodeSnippetCompileUnit.cs
- FilteredReadOnlyMetadataCollection.cs
- MediaPlayerState.cs
- MethodMessage.cs
- StringAnimationUsingKeyFrames.cs
- XmlReaderSettings.cs
- Converter.cs
- TextControlDesigner.cs
- CFGGrammar.cs
- CodeAccessPermission.cs
- TriggerBase.cs
- Pair.cs
- XmlILOptimizerVisitor.cs
- PersonalizationEntry.cs
- ArrayHelper.cs
- IPHostEntry.cs
- ResXDataNode.cs
- IssuanceTokenProviderBase.cs
- Type.cs
- DecoderFallbackWithFailureFlag.cs
- FocusManager.cs
- DispatcherSynchronizationContext.cs
- UseLicense.cs
- Pen.cs
- SynchronousChannel.cs
- CryptoKeySecurity.cs
- VisualCollection.cs
- EntitySetBase.cs
- ExtenderControl.cs
- TreeWalkHelper.cs
- SHA1.cs
- SqlUserDefinedTypeAttribute.cs
- CapabilitiesPattern.cs
- SamlAuthorityBinding.cs
- TemplatePagerField.cs
- HTTP_SERVICE_CONFIG_URLACL_KEY.cs
- HijriCalendar.cs
- ServerProtocol.cs
- AppSettingsExpressionEditor.cs
- QueueProcessor.cs
- CaseInsensitiveHashCodeProvider.cs
- DbConnectionStringCommon.cs
- RegexCharClass.cs
- EventDescriptor.cs
- PolyLineSegment.cs
- HwndTarget.cs
- MembershipAdapter.cs
- Semaphore.cs
- COSERVERINFO.cs
- CustomValidator.cs
- RetriableClipboard.cs
- SrgsRuleRef.cs
- QueryableDataSourceEditData.cs
- HttpCapabilitiesSectionHandler.cs
- SqlServices.cs
- DataGridViewCellStyleConverter.cs
- OutputCacheSettingsSection.cs
- DependencyPropertyChangedEventArgs.cs
- SettingsPropertyWrongTypeException.cs
- SendMessageContent.cs
- DataGridViewRow.cs
- Transform3DCollection.cs
- DynamicDataRouteHandler.cs
- AmbientProperties.cs
- ListControl.cs
- DataGridViewElement.cs
- ParenthesizePropertyNameAttribute.cs