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
- RotateTransform3D.cs
- LinkLabel.cs
- PropertyPathConverter.cs
- DataGridViewRowPrePaintEventArgs.cs
- Bold.cs
- DecimalConverter.cs
- Mutex.cs
- XPathNodeIterator.cs
- Logging.cs
- TextWriter.cs
- TextContainer.cs
- embossbitmapeffect.cs
- ObservableCollection.cs
- CSharpCodeProvider.cs
- SslStream.cs
- ExpressionEvaluator.cs
- GridViewColumnCollectionChangedEventArgs.cs
- XmlDataDocument.cs
- FileUtil.cs
- OSFeature.cs
- PermissionListSet.cs
- input.cs
- WebPartVerb.cs
- ScriptControl.cs
- SeverityFilter.cs
- DtdParser.cs
- XmlnsPrefixAttribute.cs
- BitmapImage.cs
- PageCodeDomTreeGenerator.cs
- dataprotectionpermissionattribute.cs
- ArraySubsetEnumerator.cs
- ShapingWorkspace.cs
- ColorContextHelper.cs
- SafeArrayTypeMismatchException.cs
- connectionpool.cs
- DbFunctionCommandTree.cs
- ButtonColumn.cs
- loginstatus.cs
- TdsParserStateObject.cs
- DEREncoding.cs
- XmlArrayItemAttributes.cs
- VisualStyleRenderer.cs
- DiagnosticTraceSchemas.cs
- TextBoxBase.cs
- PersonalizationProviderHelper.cs
- HierarchicalDataSourceIDConverter.cs
- Persist.cs
- WebException.cs
- ListenerElementsCollection.cs
- XomlDesignerLoader.cs
- MetaDataInfo.cs
- GZipStream.cs
- ViewCellRelation.cs
- DesignerDataSchemaClass.cs
- XamlPoint3DCollectionSerializer.cs
- OperationDescription.cs
- MDIClient.cs
- ExecutionEngineException.cs
- Ipv6Element.cs
- DataBoundControl.cs
- CellTreeNodeVisitors.cs
- PageContentCollection.cs
- RoleGroup.cs
- RotateTransform.cs
- _DynamicWinsockMethods.cs
- EventWaitHandle.cs
- Ops.cs
- InvalidAsynchronousStateException.cs
- CompensationHandlingFilter.cs
- RandomNumberGenerator.cs
- FamilyMapCollection.cs
- StylusPointPropertyInfoDefaults.cs
- FixedSOMPageConstructor.cs
- MenuCommand.cs
- DiscreteKeyFrames.cs
- SqlDelegatedTransaction.cs
- _HelperAsyncResults.cs
- BoundingRectTracker.cs
- PropertyGridCommands.cs
- WebPartAuthorizationEventArgs.cs
- CompressStream.cs
- WindowsProgressbar.cs
- ErrorHandler.cs
- KeyManager.cs
- StoragePropertyMapping.cs
- QilCloneVisitor.cs
- UserPreferenceChangingEventArgs.cs
- PublisherIdentityPermission.cs
- StrokeNodeOperations.cs
- ICspAsymmetricAlgorithm.cs
- RangeBaseAutomationPeer.cs
- SponsorHelper.cs
- DataGridView.cs
- ProtocolViolationException.cs
- XpsStructure.cs
- ListBoxChrome.cs
- XmlArrayItemAttribute.cs
- TextEditorMouse.cs
- CollectionBase.cs
- SerializableAttribute.cs