Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Base / System / Windows / Markup / Primitives / MarkupProperty.cs / 1305600 / MarkupProperty.cs
//------------------------------------------------------------------------ // // Microsoft Windows Client Platform // Copyright (C) Microsoft Corporation, 2005 // // File: MarkupProperty.cs // // Contents: API for iterating a tree of objects for serialization // // Created: 04/28/2005 [....] // //----------------------------------------------------------------------- using System; using System.ComponentModel; using System.Collections.Generic; using System.Collections; using System.Reflection; using System.Text; using System.Windows; using MS.Internal.WindowsBase; namespace System.Windows.Markup.Primitives { ////// A property description used by serialiation to encapsulate access to properties and their values. A property is /// either representable as a string or a list of items. If the property can be respresented as a string /// IsComposite is false, otherwise, if IsComposite is true, the property is a list of items. /// public abstract class MarkupProperty { ////// Prevent external specialization /// [FriendAccessAllowed] // Used by MarkupPropertyWrapper internal MarkupProperty() { } ////// A name sutible for diagnostics and error reporting. A serializer should not use this value. It should use /// the PropertyDescriptor and/or DependencyProperty instead. /// public abstract string Name { get; } ////// The type of the property. /// public abstract Type PropertyType { get; } ////// whether the property type is a collection or not /// internal bool IsCollectionProperty { get { Type propertyType = PropertyType; return (typeof(IList).IsAssignableFrom(propertyType) || typeof(IDictionary).IsAssignableFrom(propertyType) || propertyType.IsArray); } } ////// The property descriptor for the markup property if this property is associated with a CLR property. /// public virtual PropertyDescriptor PropertyDescriptor { get { return null; } } ////// The dependency property for the markup property if this property is backed by a DependencyProperty. /// public virtual DependencyProperty DependencyProperty { get { return null; } } ////// Returns true when this propety is an attached dependency property. When true, PropertyDescriptor /// can be null (but is not required to be) and DependencyProperty is not null. /// public virtual bool IsAttached { get { return false; } } ////// Returns true when this property represents a constructor argument. When true, PropertyDescriptor and /// DependencyProperty are both null. XAML only uses this for represnting the constructor parameters of /// MarkupExtension instances. /// public virtual bool IsConstructorArgument { get { return false; } } ////// Returns true when this property represents the text to pass to the type's ValueConverter to create an /// instance instead of using a constructor. When true, PropertyDescriptor and DependencyProperty are both /// null. If a property is provided through MarkupItem.Properties that has this value set to true it is the /// only property the type will provide. /// public virtual bool IsValueAsString { get { return false; } } ////// Returns true when this property represents direct content of a collection (or dictionary) class. When true, /// PropertyDescriptor and DependencyProperty are both null. /// public virtual bool IsContent { get { return false; } } ////// Returns true when the property represents the key used by the MarkupItem's container to store the item in a /// dictionary. When true, the PropertyDescriptor and DependencyProperty will return null. XAML will emit this /// as an x:Key attribute. /// public virtual bool IsKey { get { return false; } } ////// If IsComposite is false Value and StringValue are valid to call, the property can be represented as a /// string. If is true, Items is valid to use and the property is one or more items. If the property is /// composite but has not items, the property isn't returned by MarkupItem.GetProperties. /// public virtual bool IsComposite { get { return false; } } ////// The current value of the property. /// public abstract object Value { get; } ////// The string value of the property using ValueSerializer classes when appropriate to convert the value to a /// string. Which ValueSerializer to invoke is determined by the IValueSerializerContext of the MarkupItem that /// returned this MarkupProperty. /// public abstract string StringValue { get; } ////// The list of types that this property will reference when it serializes its value as a string. This allows /// a serializer to ensure that the de-serializer has enough information to convert references to these type /// from the string representations. For example, ensuring there is an xmlns declaration for the XML namespace /// that defines the type. /// public abstract IEnumerableTypeReferences { get; } /// /// Enumerate the items that make up the value of this property. If the property is not an enumeration, this /// will only be one item in the enumeration. If the property is an enumeration (or enumerable) then all the /// items will be returned. At least one will always be returned since it MarkupItem will not create a /// MarkupProperty for properties with no items. /// public abstract IEnumerableItems { get; } /// /// The attributes associated with the markup property. /// public abstract AttributeCollection Attributes { get; } ////// Checks to see that each markup object is of a public type. Used in serialization. /// internal virtual void VerifyOnlySerializableTypes() { } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------ // // Microsoft Windows Client Platform // Copyright (C) Microsoft Corporation, 2005 // // File: MarkupProperty.cs // // Contents: API for iterating a tree of objects for serialization // // Created: 04/28/2005 [....] // //----------------------------------------------------------------------- using System; using System.ComponentModel; using System.Collections.Generic; using System.Collections; using System.Reflection; using System.Text; using System.Windows; using MS.Internal.WindowsBase; namespace System.Windows.Markup.Primitives { ////// A property description used by serialiation to encapsulate access to properties and their values. A property is /// either representable as a string or a list of items. If the property can be respresented as a string /// IsComposite is false, otherwise, if IsComposite is true, the property is a list of items. /// public abstract class MarkupProperty { ////// Prevent external specialization /// [FriendAccessAllowed] // Used by MarkupPropertyWrapper internal MarkupProperty() { } ////// A name sutible for diagnostics and error reporting. A serializer should not use this value. It should use /// the PropertyDescriptor and/or DependencyProperty instead. /// public abstract string Name { get; } ////// The type of the property. /// public abstract Type PropertyType { get; } ////// whether the property type is a collection or not /// internal bool IsCollectionProperty { get { Type propertyType = PropertyType; return (typeof(IList).IsAssignableFrom(propertyType) || typeof(IDictionary).IsAssignableFrom(propertyType) || propertyType.IsArray); } } ////// The property descriptor for the markup property if this property is associated with a CLR property. /// public virtual PropertyDescriptor PropertyDescriptor { get { return null; } } ////// The dependency property for the markup property if this property is backed by a DependencyProperty. /// public virtual DependencyProperty DependencyProperty { get { return null; } } ////// Returns true when this propety is an attached dependency property. When true, PropertyDescriptor /// can be null (but is not required to be) and DependencyProperty is not null. /// public virtual bool IsAttached { get { return false; } } ////// Returns true when this property represents a constructor argument. When true, PropertyDescriptor and /// DependencyProperty are both null. XAML only uses this for represnting the constructor parameters of /// MarkupExtension instances. /// public virtual bool IsConstructorArgument { get { return false; } } ////// Returns true when this property represents the text to pass to the type's ValueConverter to create an /// instance instead of using a constructor. When true, PropertyDescriptor and DependencyProperty are both /// null. If a property is provided through MarkupItem.Properties that has this value set to true it is the /// only property the type will provide. /// public virtual bool IsValueAsString { get { return false; } } ////// Returns true when this property represents direct content of a collection (or dictionary) class. When true, /// PropertyDescriptor and DependencyProperty are both null. /// public virtual bool IsContent { get { return false; } } ////// Returns true when the property represents the key used by the MarkupItem's container to store the item in a /// dictionary. When true, the PropertyDescriptor and DependencyProperty will return null. XAML will emit this /// as an x:Key attribute. /// public virtual bool IsKey { get { return false; } } ////// If IsComposite is false Value and StringValue are valid to call, the property can be represented as a /// string. If is true, Items is valid to use and the property is one or more items. If the property is /// composite but has not items, the property isn't returned by MarkupItem.GetProperties. /// public virtual bool IsComposite { get { return false; } } ////// The current value of the property. /// public abstract object Value { get; } ////// The string value of the property using ValueSerializer classes when appropriate to convert the value to a /// string. Which ValueSerializer to invoke is determined by the IValueSerializerContext of the MarkupItem that /// returned this MarkupProperty. /// public abstract string StringValue { get; } ////// The list of types that this property will reference when it serializes its value as a string. This allows /// a serializer to ensure that the de-serializer has enough information to convert references to these type /// from the string representations. For example, ensuring there is an xmlns declaration for the XML namespace /// that defines the type. /// public abstract IEnumerableTypeReferences { get; } /// /// Enumerate the items that make up the value of this property. If the property is not an enumeration, this /// will only be one item in the enumeration. If the property is an enumeration (or enumerable) then all the /// items will be returned. At least one will always be returned since it MarkupItem will not create a /// MarkupProperty for properties with no items. /// public abstract IEnumerableItems { get; } /// /// The attributes associated with the markup property. /// public abstract AttributeCollection Attributes { get; } ////// Checks to see that each markup object is of a public type. Used in serialization. /// internal virtual void VerifyOnlySerializableTypes() { } } } // 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
- DesignBindingEditor.cs
- SmtpDigestAuthenticationModule.cs
- TransformerTypeCollection.cs
- ContractNamespaceAttribute.cs
- HostProtectionException.cs
- GraphicsPathIterator.cs
- LinqDataSourceValidationException.cs
- ReadOnlyDataSourceView.cs
- IPeerNeighbor.cs
- ProjectionPruner.cs
- SqlTrackingQuery.cs
- ListViewHitTestInfo.cs
- FontStyleConverter.cs
- HTTPRemotingHandler.cs
- WindowShowOrOpenTracker.cs
- WebEvents.cs
- SchemaImporterExtension.cs
- TreeNodeCollectionEditor.cs
- WebPartDisplayModeEventArgs.cs
- FixUpCollection.cs
- HtmlElementEventArgs.cs
- MailAddressParser.cs
- VersionPair.cs
- Expression.cs
- InlineCollection.cs
- XD.cs
- SimpleType.cs
- ObjectItemLoadingSessionData.cs
- XmlCompatibilityReader.cs
- FixedTextPointer.cs
- FormViewDeletedEventArgs.cs
- SharedRuntimeState.cs
- IncrementalReadDecoders.cs
- HostedAspNetEnvironment.cs
- TemplateField.cs
- CrossContextChannel.cs
- FtpCachePolicyElement.cs
- PointHitTestParameters.cs
- Point3DAnimationUsingKeyFrames.cs
- ContentAlignmentEditor.cs
- RenderOptions.cs
- SqlHelper.cs
- DataGrid.cs
- PerformanceCounterPermissionEntryCollection.cs
- _UriSyntax.cs
- CreateUserErrorEventArgs.cs
- RegexMatch.cs
- OpenTypeLayout.cs
- DataGridViewCellStateChangedEventArgs.cs
- HttpListenerRequest.cs
- PerfCounters.cs
- MultiSelectRootGridEntry.cs
- CellLabel.cs
- ToolCreatedEventArgs.cs
- EdmToObjectNamespaceMap.cs
- OwnerDrawPropertyBag.cs
- ActiveDocumentEvent.cs
- NodeInfo.cs
- OleDbPermission.cs
- DataGridViewColumn.cs
- TextEditorCopyPaste.cs
- HwndHostAutomationPeer.cs
- Int32CollectionValueSerializer.cs
- PagedDataSource.cs
- DataGridViewToolTip.cs
- IssuedSecurityTokenProvider.cs
- ImageSourceValueSerializer.cs
- DataGridViewCellPaintingEventArgs.cs
- _SslStream.cs
- ApplicationFileCodeDomTreeGenerator.cs
- CommandDevice.cs
- TextElementEditingBehaviorAttribute.cs
- NotifyParentPropertyAttribute.cs
- IgnoreFlushAndCloseStream.cs
- DataGrid.cs
- Rect3DConverter.cs
- StringOutput.cs
- ConditionalDesigner.cs
- EntitySqlQueryState.cs
- BmpBitmapEncoder.cs
- DataBoundLiteralControl.cs
- StateRuntime.cs
- MainMenu.cs
- ConnectionConsumerAttribute.cs
- TextElementEnumerator.cs
- HashHelper.cs
- ScriptingRoleServiceSection.cs
- InstanceHandle.cs
- NameValuePair.cs
- PartialTrustVisibleAssembly.cs
- ShapingWorkspace.cs
- BuildProvider.cs
- CheckoutException.cs
- XmlHierarchyData.cs
- XmlQueryType.cs
- _ConnectionGroup.cs
- smtpconnection.cs
- ClientScriptManager.cs
- OrderedDictionaryStateHelper.cs
- TypeLoadException.cs