Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TypeUtils.cs
- ZeroOpNode.cs
- EntityDataSourceDataSelection.cs
- VectorValueSerializer.cs
- ReadOnlyHierarchicalDataSource.cs
- DomainConstraint.cs
- OrderedDictionary.cs
- ListViewHitTestInfo.cs
- Duration.cs
- FormViewCommandEventArgs.cs
- CreateUserErrorEventArgs.cs
- WebPartDescriptionCollection.cs
- SecureEnvironment.cs
- SystemResources.cs
- PrintingPermission.cs
- SortDescriptionCollection.cs
- JoinSymbol.cs
- DataFormats.cs
- MSAANativeProvider.cs
- ErrorTableItemStyle.cs
- DirectoryInfo.cs
- UxThemeWrapper.cs
- Int16KeyFrameCollection.cs
- EndpointAddressMessageFilterTable.cs
- WsatAdminException.cs
- Size.cs
- Guid.cs
- EmptyCollection.cs
- ActivityCodeDomSerializationManager.cs
- Regex.cs
- SerializationObjectManager.cs
- PeerNameRecordCollection.cs
- ValuePatternIdentifiers.cs
- BrushConverter.cs
- SQLInt16.cs
- X509CertificateStore.cs
- TypeConverterHelper.cs
- Lookup.cs
- ContentPosition.cs
- CompositeClientFormatter.cs
- NestPullup.cs
- XamlPathDataSerializer.cs
- SrgsGrammarCompiler.cs
- MethodRental.cs
- WebBrowser.cs
- SessionStateModule.cs
- ParseNumbers.cs
- TextPointer.cs
- HttpRequestTraceRecord.cs
- AuthenticationService.cs
- ToolboxItemCollection.cs
- EventMappingSettings.cs
- Assign.cs
- RtfFormatStack.cs
- SqlSelectClauseBuilder.cs
- ApplyTemplatesAction.cs
- TextParagraphProperties.cs
- DecimalMinMaxAggregationOperator.cs
- ConditionalAttribute.cs
- DataBoundControlParameterTarget.cs
- EntityDataSourceWrapperCollection.cs
- CacheSection.cs
- DescendentsWalkerBase.cs
- Panel.cs
- ToolStripDropDownItem.cs
- StateMachineWorkflowInstance.cs
- StronglyTypedResourceBuilder.cs
- XmlLoader.cs
- RegularExpressionValidator.cs
- MetaData.cs
- DataGridViewColumnCollectionDialog.cs
- ArrangedElementCollection.cs
- AttributeQuery.cs
- Schema.cs
- MissingFieldException.cs
- DataKeyCollection.cs
- InputLanguageProfileNotifySink.cs
- _SslSessionsCache.cs
- RoleManagerModule.cs
- XDRSchema.cs
- Splitter.cs
- HtmlInputPassword.cs
- PackagePartCollection.cs
- OleDbPermission.cs
- XmlSignatureProperties.cs
- ExcCanonicalXml.cs
- DropDownButton.cs
- ColumnHeader.cs
- Rule.cs
- Material.cs
- FontDifferentiator.cs
- WebExceptionStatus.cs
- FieldBuilder.cs
- JsonWriter.cs
- RepeatButtonAutomationPeer.cs
- DataBoundControl.cs
- ExtentCqlBlock.cs
- SpellerError.cs
- TypeConverterHelper.cs
- ConnectionManagementSection.cs