Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- EncryptedXml.cs
- DataGridAddNewRow.cs
- DES.cs
- DateTimeValueSerializer.cs
- DisplayInformation.cs
- CanExecuteRoutedEventArgs.cs
- SerializationStore.cs
- MetricEntry.cs
- DetailsViewCommandEventArgs.cs
- CustomError.cs
- EntityDataSourceStatementEditor.cs
- RadioButtonStandardAdapter.cs
- serverconfig.cs
- HelpHtmlBuilder.cs
- InplaceBitmapMetadataWriter.cs
- FormsAuthenticationEventArgs.cs
- QuaternionAnimationUsingKeyFrames.cs
- PowerStatus.cs
- ScriptRegistrationManager.cs
- shaperfactoryquerycachekey.cs
- BuildProviderCollection.cs
- ToolStripComboBox.cs
- FormCollection.cs
- StringUtil.cs
- TableDetailsRow.cs
- ModelUIElement3D.cs
- HelpKeywordAttribute.cs
- printdlgexmarshaler.cs
- ListBindingConverter.cs
- AssertFilter.cs
- PointHitTestResult.cs
- ColumnResult.cs
- ValidateNames.cs
- ToolStripContentPanelRenderEventArgs.cs
- XmlSortKey.cs
- dtdvalidator.cs
- LastQueryOperator.cs
- ActivityValidator.cs
- SqlDataReaderSmi.cs
- DbMetaDataFactory.cs
- SamlAttributeStatement.cs
- MemberPath.cs
- Table.cs
- XmlReaderSettings.cs
- MDIControlStrip.cs
- fixedPageContentExtractor.cs
- XmlSchemaSimpleContentExtension.cs
- SetStoryboardSpeedRatio.cs
- dataSvcMapFileLoader.cs
- _ServiceNameStore.cs
- StringArrayConverter.cs
- CheckoutException.cs
- UInt64Converter.cs
- ResourceManager.cs
- SqlNotificationEventArgs.cs
- ReadOnlyDictionary.cs
- OptimalTextSource.cs
- EdmTypeAttribute.cs
- ConfigXmlText.cs
- NativeMethods.cs
- TaiwanLunisolarCalendar.cs
- ControlAdapter.cs
- LogicalMethodInfo.cs
- MeasureItemEvent.cs
- InkCollectionBehavior.cs
- HtmlInputButton.cs
- Stream.cs
- DbConnectionPoolIdentity.cs
- DataServiceQueryOfT.cs
- SafeNativeMethods.cs
- Point4DConverter.cs
- IPAddress.cs
- Pen.cs
- Decimal.cs
- ControlParameter.cs
- MatrixTransform3D.cs
- Normalization.cs
- LocalizableAttribute.cs
- CustomAttributeFormatException.cs
- SortedList.cs
- IFormattable.cs
- CodeExpressionCollection.cs
- WeakReferenceKey.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- AssemblySettingAttributes.cs
- SmiEventSink_Default.cs
- Shared.cs
- CounterCreationDataConverter.cs
- ExpandSegmentCollection.cs
- AutoCompleteStringCollection.cs
- UnSafeCharBuffer.cs
- PcmConverter.cs
- ObjectQueryState.cs
- FunctionUpdateCommand.cs
- Automation.cs
- CFGGrammar.cs
- HtmlContainerControl.cs
- WindowsGraphicsWrapper.cs
- BinaryObjectReader.cs
- ObjectHelper.cs