Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / MS / Internal / Data / BindingWorker.cs / 2 / 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
- OperatorExpressions.cs
- EndpointIdentityConverter.cs
- XmlEntityReference.cs
- CredentialCache.cs
- RuntimeWrappedException.cs
- ISAPIApplicationHost.cs
- DataGridRow.cs
- ValueTypeFixupInfo.cs
- xmlfixedPageInfo.cs
- AxParameterData.cs
- CheckBoxField.cs
- arc.cs
- SqlBuffer.cs
- OrCondition.cs
- ImageListUtils.cs
- DesignerOptionService.cs
- WrappedReader.cs
- ValidatingReaderNodeData.cs
- ServiceOperationDetailViewControl.cs
- SchemaObjectWriter.cs
- DBSchemaRow.cs
- AssertFilter.cs
- FunctionUpdateCommand.cs
- SqlUtil.cs
- SystemFonts.cs
- Common.cs
- GenericXmlSecurityToken.cs
- ScalarOps.cs
- Int32AnimationUsingKeyFrames.cs
- GlobalItem.cs
- _NestedSingleAsyncResult.cs
- DrawingImage.cs
- ThousandthOfEmRealPoints.cs
- OrderedDictionary.cs
- RbTree.cs
- SettingsSavedEventArgs.cs
- FixedSOMPageElement.cs
- FormCollection.cs
- WorkflowServiceBehavior.cs
- DefaultValidator.cs
- ListBoxChrome.cs
- OrderedHashRepartitionStream.cs
- AsymmetricSignatureFormatter.cs
- EdmProperty.cs
- CodeIdentifiers.cs
- ContainerUtilities.cs
- SafeUserTokenHandle.cs
- TcpPortSharing.cs
- XmlIncludeAttribute.cs
- QilReference.cs
- XamlTypeMapper.cs
- PeerNeighborManager.cs
- IIS7WorkerRequest.cs
- HtmlInputSubmit.cs
- ThicknessAnimationUsingKeyFrames.cs
- EntityDataSourceQueryBuilder.cs
- SmiTypedGetterSetter.cs
- DataPagerField.cs
- SqlBulkCopyColumnMappingCollection.cs
- ExpandSegmentCollection.cs
- PreservationFileWriter.cs
- WmlPhoneCallAdapter.cs
- SamlEvidence.cs
- MoveSizeWinEventHandler.cs
- ForceCopyBuildProvider.cs
- BypassElementCollection.cs
- WebPartDisplayModeCancelEventArgs.cs
- ConfigurationSection.cs
- MediaPlayerState.cs
- ResourceCategoryAttribute.cs
- IdentityVerifier.cs
- ObjectViewFactory.cs
- VisualStyleRenderer.cs
- CodeMemberField.cs
- WebRequestModuleElement.cs
- BuildManagerHost.cs
- SizeChangedInfo.cs
- RealizationDrawingContextWalker.cs
- RectAnimationUsingKeyFrames.cs
- StorageEndPropertyMapping.cs
- SQLConvert.cs
- CommonProperties.cs
- Int32AnimationBase.cs
- UserControlParser.cs
- NamedPipeConnectionPool.cs
- LicenseContext.cs
- AssociationSetMetadata.cs
- AutomationPatternInfo.cs
- InvokeFunc.cs
- VoiceSynthesis.cs
- mactripleDES.cs
- GridViewAutoFormat.cs
- DataMemberConverter.cs
- TextAdaptor.cs
- FileChangesMonitor.cs
- SqlClientWrapperSmiStream.cs
- SignedXml.cs
- RegexCode.cs
- PropertyInfoSet.cs
- ResourceReader.cs