Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / Data / PriorityBinding.cs / 1 / PriorityBinding.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: Defines PriorityBinding object, which stores information // for creating instances of PriorityBindingExpression objects. // // See spec at [....]/connecteddata/Specs/Data%20Binding.mht // //--------------------------------------------------------------------------- using System; using System.Collections; using System.Collections.ObjectModel; // Collectionusing System.ComponentModel; using System.Globalization; using System.Windows.Markup; using MS.Internal.Data; using MS.Utility; namespace System.Windows.Data { /// /// Describes a collection of bindings attached to a single property. /// These behave as "priority" bindings, meaning that the property /// receives its value from the first binding in the collection that /// can produce a legal value. /// [ContentProperty("Bindings")] public class PriorityBinding : BindingBase, IAddChild { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- ///Constructor public PriorityBinding() : base() { _bindingCollection = new BindingCollection(this, new BindingCollectionChangedCallback(OnBindingCollectionChanged)); } #region IAddChild ////// Called to Add the object as a Child. /// /// /// Object to add as a child - must have type BindingBase /// void IAddChild.AddChild(Object value) { BindingBase binding = value as BindingBase; if (binding != null) Bindings.Add(binding); else throw new ArgumentException(SR.Get(SRID.ChildHasWrongType, this.GetType().Name, "BindingBase", value.GetType().FullName), "value"); } ////// Called when text appears under the tag in markup /// /// /// Text to Add to the Object /// void IAddChild.AddText(string text) { XamlSerializerUtil.ThrowIfNonWhiteSpaceInAddText(text, this); } #endregion IAddChild //------------------------------------------------------ // // Public Properties // //----------------------------------------------------- ///List of inner bindings [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public CollectionBindings { get { return _bindingCollection; } } /// /// This method is used by TypeDescriptor to determine if this property should /// be serialized. /// [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeBindings() { return (Bindings != null && Bindings.Count > 0); } //------------------------------------------------------ // // Protected Methods // //------------------------------------------------------ ////// Create an appropriate expression for this Binding, to be attached /// to the given DependencyProperty on the given DependencyObject. /// internal override BindingExpressionBase CreateBindingExpressionOverride(DependencyObject target, DependencyProperty dp, BindingExpressionBase owner) { return PriorityBindingExpression.CreateBindingExpression(target, dp, this, owner); } private void OnBindingCollectionChanged() { CheckSealed(); } //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ BindingCollection _bindingCollection; } } // 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
- ImageFormatConverter.cs
- IPGlobalProperties.cs
- Activity.cs
- BCLDebug.cs
- TextTrailingWordEllipsis.cs
- RSAOAEPKeyExchangeDeformatter.cs
- ThicknessConverter.cs
- ServiceProviders.cs
- CodeEventReferenceExpression.cs
- PropertyValidationContext.cs
- EdgeProfileValidation.cs
- TableAdapterManagerNameHandler.cs
- IxmlLineInfo.cs
- SqlCacheDependencyDatabase.cs
- Message.cs
- DbConnectionFactory.cs
- MergePropertyDescriptor.cs
- externdll.cs
- TemporaryBitmapFile.cs
- ContextMarshalException.cs
- Type.cs
- AnimationLayer.cs
- ValidationError.cs
- ImmComposition.cs
- AttachmentCollection.cs
- BufferedReadStream.cs
- base64Transforms.cs
- ContainerControl.cs
- XmlArrayItemAttributes.cs
- ReferentialConstraintRoleElement.cs
- Listbox.cs
- TypedCompletedAsyncResult.cs
- FixedSOMSemanticBox.cs
- ResizingMessageFilter.cs
- ReaderOutput.cs
- ObjectViewListener.cs
- XmlBinaryWriterSession.cs
- TitleStyle.cs
- UrlAuthFailedErrorFormatter.cs
- WorkflowInlining.cs
- DataMemberConverter.cs
- HostSecurityManager.cs
- BitmapImage.cs
- DecoderExceptionFallback.cs
- IntellisenseTextBox.cs
- CodeRegionDirective.cs
- RedistVersionInfo.cs
- Rect.cs
- Util.cs
- CompressEmulationStream.cs
- FileStream.cs
- SQLConvert.cs
- RNGCryptoServiceProvider.cs
- ReturnEventArgs.cs
- OpCellTreeNode.cs
- SystemUnicastIPAddressInformation.cs
- URLIdentityPermission.cs
- FragmentNavigationEventArgs.cs
- EntityException.cs
- ClientFormsAuthenticationCredentials.cs
- GraphicsPathIterator.cs
- EditingCommands.cs
- GridItem.cs
- SerialPinChanges.cs
- InternalSafeNativeMethods.cs
- ApplicationCommands.cs
- List.cs
- CompleteWizardStep.cs
- CapabilitiesRule.cs
- WebBrowserNavigatedEventHandler.cs
- AssemblyFilter.cs
- TreeNode.cs
- StubHelpers.cs
- Pointer.cs
- ConversionContext.cs
- TimeSpanConverter.cs
- CustomErrorsSection.cs
- XmlSchemaObjectTable.cs
- BidOverLoads.cs
- VectorCollectionConverter.cs
- SqlOuterApplyReducer.cs
- IListConverters.cs
- SamlSerializer.cs
- _DomainName.cs
- InvalidDataException.cs
- CodeGenerator.cs
- Label.cs
- SharedUtils.cs
- OdbcStatementHandle.cs
- DatatypeImplementation.cs
- CategoryState.cs
- FixedDSBuilder.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- FrameworkElementFactory.cs
- ByteAnimation.cs
- xmlglyphRunInfo.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- XPathExpr.cs
- Paragraph.cs
- HatchBrush.cs