Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / Model / AttachedPropertyDescriptor.cs / 1305376 / AttachedPropertyDescriptor.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation.Model { using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel; using System.Activities.Presentation.Model; class AttachedPropertyDescriptor : PropertyDescriptor { AttachedProperty AttachedProperty; ModelItem owner; public AttachedPropertyDescriptor(AttachedProperty AttachedProperty, ModelItem owner) : base(AttachedProperty.Name, null) { this.AttachedProperty = AttachedProperty; this.owner = owner; } public override AttributeCollection Attributes { get { ListattributeList = new List (); foreach (Attribute attr in TypeDescriptor.GetAttributes(this.PropertyType)) { attributeList.Add(attr); } BrowsableAttribute browsableAttribute = new BrowsableAttribute(this.IsBrowsable); attributeList.Add(browsableAttribute); return new AttributeCollection(attributeList.ToArray()); } } public override Type ComponentType { get { return this.owner.ItemType; } } public override bool IsReadOnly { get { return this.AttachedProperty.IsReadOnly; } } public override Type PropertyType { get { return this.AttachedProperty.Type; } } public override bool IsBrowsable { get { return this.AttachedProperty.IsBrowsable; } } public override bool CanResetValue(object component) { return false; } public override object GetValue(object component) { return this.AttachedProperty.GetValue(owner); } public override void ResetValue(object component) { this.AttachedProperty.ResetValue(owner); } public override void SetValue(object component, object value) { this.AttachedProperty.SetValue(owner, value); } public override bool ShouldSerializeValue(object component) { return false; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation.Model { using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel; using System.Activities.Presentation.Model; class AttachedPropertyDescriptor : PropertyDescriptor { AttachedProperty AttachedProperty; ModelItem owner; public AttachedPropertyDescriptor(AttachedProperty AttachedProperty, ModelItem owner) : base(AttachedProperty.Name, null) { this.AttachedProperty = AttachedProperty; this.owner = owner; } public override AttributeCollection Attributes { get { List attributeList = new List (); foreach (Attribute attr in TypeDescriptor.GetAttributes(this.PropertyType)) { attributeList.Add(attr); } BrowsableAttribute browsableAttribute = new BrowsableAttribute(this.IsBrowsable); attributeList.Add(browsableAttribute); return new AttributeCollection(attributeList.ToArray()); } } public override Type ComponentType { get { return this.owner.ItemType; } } public override bool IsReadOnly { get { return this.AttachedProperty.IsReadOnly; } } public override Type PropertyType { get { return this.AttachedProperty.Type; } } public override bool IsBrowsable { get { return this.AttachedProperty.IsBrowsable; } } public override bool CanResetValue(object component) { return false; } public override object GetValue(object component) { return this.AttachedProperty.GetValue(owner); } public override void ResetValue(object component) { this.AttachedProperty.ResetValue(owner); } public override void SetValue(object component, object value) { this.AttachedProperty.SetValue(owner, value); } public override bool ShouldSerializeValue(object component) { return false; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SubMenuStyleCollection.cs
- StrokeNode.cs
- ReflectionUtil.cs
- UniqueEventHelper.cs
- WebFaultClientMessageInspector.cs
- ClientSettings.cs
- Identifier.cs
- SerializationInfo.cs
- TextTreeTextElementNode.cs
- WindowsFormsSynchronizationContext.cs
- BindingListCollectionView.cs
- DataGridViewRowsAddedEventArgs.cs
- LineSegment.cs
- EditorResources.cs
- AlternateViewCollection.cs
- ImagingCache.cs
- FixedDocumentPaginator.cs
- XamlParser.cs
- PresentationSource.cs
- Parser.cs
- BindUriHelper.cs
- XmlWriter.cs
- StateManagedCollection.cs
- Command.cs
- ControlType.cs
- HTTP_SERVICE_CONFIG_URLACL_PARAM.cs
- RouteParser.cs
- ContextQuery.cs
- DependencyObjectPropertyDescriptor.cs
- WhitespaceSignificantCollectionAttribute.cs
- COM2ColorConverter.cs
- DataGridViewColumnHeaderCell.cs
- UIElementAutomationPeer.cs
- PeerResolver.cs
- AutoScrollHelper.cs
- SynchronizedRandom.cs
- SqlCacheDependencyDatabaseCollection.cs
- ButtonBase.cs
- SpellCheck.cs
- TypeToArgumentTypeConverter.cs
- MediaElementAutomationPeer.cs
- PixelShader.cs
- HwndKeyboardInputProvider.cs
- TabRenderer.cs
- EntityConnectionStringBuilder.cs
- Pointer.cs
- IISMapPath.cs
- RenderOptions.cs
- FormsAuthenticationTicket.cs
- CollectionBuilder.cs
- WsatProxy.cs
- HtmlTernaryTree.cs
- COM2FontConverter.cs
- EUCJPEncoding.cs
- ForeignConstraint.cs
- AsymmetricSignatureDeformatter.cs
- DrawingServices.cs
- Renderer.cs
- ClientSettingsSection.cs
- HwndPanningFeedback.cs
- RadioButtonRenderer.cs
- CompilerLocalReference.cs
- DrawingAttributes.cs
- SqlDataAdapter.cs
- MultiAsyncResult.cs
- CompilationRelaxations.cs
- SystemNetworkInterface.cs
- RequestQueue.cs
- StateBag.cs
- WpfSharedXamlSchemaContext.cs
- SessionStateUtil.cs
- SrgsRulesCollection.cs
- XmlWrappingReader.cs
- CheckPair.cs
- UnsafeNativeMethods.cs
- VisualStyleElement.cs
- BaseProcessor.cs
- EventSinkHelperWriter.cs
- TraversalRequest.cs
- PackUriHelper.cs
- FormatStringEditor.cs
- SafeNativeMethods.cs
- TaskFormBase.cs
- ContourSegment.cs
- PropertyGrid.cs
- SingleResultAttribute.cs
- HttpCachePolicy.cs
- TypefaceCollection.cs
- ProfileGroupSettingsCollection.cs
- Part.cs
- FormsAuthenticationUser.cs
- StylusButtonEventArgs.cs
- DbDataRecord.cs
- DocumentOrderComparer.cs
- RequestCachePolicyConverter.cs
- MobileControlsSectionHandler.cs
- Part.cs
- WindowsStartMenu.cs
- AttributeEmitter.cs
- AsymmetricSignatureFormatter.cs