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
- XmlCollation.cs
- DictionaryBase.cs
- MetadataArtifactLoaderCompositeFile.cs
- FontUnitConverter.cs
- EmissiveMaterial.cs
- TdsValueSetter.cs
- NavigationFailedEventArgs.cs
- NumericPagerField.cs
- ScriptingWebServicesSectionGroup.cs
- CommonDialog.cs
- SmiEventSink.cs
- CssClassPropertyAttribute.cs
- XmlNodeChangedEventArgs.cs
- SHA256.cs
- NativeCppClassAttribute.cs
- RepeatBehaviorConverter.cs
- DataGridViewHeaderCell.cs
- SaveWorkflowAsyncResult.cs
- OleAutBinder.cs
- SQLStringStorage.cs
- WebPartConnectVerb.cs
- WizardPanelChangingEventArgs.cs
- TemplateBaseAction.cs
- CodeAccessSecurityEngine.cs
- TypeConverterHelper.cs
- ScrollBar.cs
- GlobalItem.cs
- ScrollItemPattern.cs
- TextTrailingWordEllipsis.cs
- MessageBox.cs
- ValidatingCollection.cs
- DesignerLinkAdapter.cs
- ToolConsole.cs
- TextBox.cs
- HyperLinkColumn.cs
- ImagingCache.cs
- ListViewInsertEventArgs.cs
- AcceleratedTokenProvider.cs
- PointHitTestParameters.cs
- AdRotator.cs
- WorkBatch.cs
- GridViewCommandEventArgs.cs
- _NegotiateClient.cs
- RowToFieldTransformer.cs
- PrintControllerWithStatusDialog.cs
- CommaDelimitedStringAttributeCollectionConverter.cs
- SqlTriggerAttribute.cs
- DmlSqlGenerator.cs
- ToolStripMenuItem.cs
- ProxyAttribute.cs
- metadatamappinghashervisitor.cs
- AsyncOperationManager.cs
- EntityObject.cs
- DataBinder.cs
- ExpandableObjectConverter.cs
- ScriptReferenceEventArgs.cs
- DesignerAttribute.cs
- DataSysAttribute.cs
- IpcClientChannel.cs
- HierarchicalDataSourceControl.cs
- ReadOnlyDictionary.cs
- SQLRoleProvider.cs
- Mappings.cs
- PermissionAttributes.cs
- HttpClientCertificate.cs
- ResourceReader.cs
- NTAccount.cs
- SafeFileMapViewHandle.cs
- RegexWriter.cs
- XmlSchemaSet.cs
- EntityClientCacheKey.cs
- ValueType.cs
- precedingsibling.cs
- QueuedDeliveryRequirementsMode.cs
- ToolConsole.cs
- ClientSettingsStore.cs
- SHA256Managed.cs
- DeploymentSection.cs
- SQLSingle.cs
- SystemIPAddressInformation.cs
- LinqDataSourceContextEventArgs.cs
- XmlHierarchicalEnumerable.cs
- NameValueCache.cs
- ImageList.cs
- BaseDataBoundControl.cs
- CounterCreationDataCollection.cs
- SizeAnimationUsingKeyFrames.cs
- SqlDataAdapter.cs
- ButtonChrome.cs
- WinFormsUtils.cs
- SQLInt32.cs
- SerialStream.cs
- SqlXml.cs
- XslTransform.cs
- WebConfigurationManager.cs
- CodeIdentifiers.cs
- SecurityException.cs
- SmiEventSink_DeferedProcessing.cs
- TextTreePropertyUndoUnit.cs
- Menu.cs