XamlType 类

定义

报告作为整体 XAML 系统(在 .NET Framework XAML 服务中实现)的一部分的 XAML 类型相关信息。Reports information about XAML types as part of the overall XAML system that is implemented in .NET Framework XAML Services.

public ref class XamlType : IEquatable<System::Xaml::XamlType ^>
public class XamlType : IEquatable<System.Xaml.XamlType>
type XamlType = class
    interface IEquatable<XamlType>
Public Class XamlType
Implements IEquatable(Of XamlType)
继承
XamlType
实现

注解

XamlType 类中的多个 Api 提供了有关 XAML 类型的信息,其中所报告的概念类似于 XAML 规范 [MS-CHAP] 的特定部分。Many APIs in the XamlType class provide information about XAML types, where the concept they report on is similar to particular sections of the XAML specification [MS-XAML].

XamlType 广泛用于用于报告 XAML 类型信息的 .NET Framework XAML 服务 API。XamlType is used extensively in the .NET Framework XAML Services API for reporting information about a XAML type. XamlType 将报告您需要了解的有关 XAML 类型的信息,以便使用实例或从 XAML 节点流访问其成员,或者使用类似的 XAML 表示形式。XamlType reports the information that you might need to know about a XAML type in order to work with an instance or to access its members from a XAML node stream, or a similar XAML representation. 它的报告类似于 CLR 类型系统中的 Type 如何结合反射类(如 MemberInfo)提供有关 CLR 类型及其用法的信息。Its reporting is similar to how the Type in the CLR type system, together with reflection classes such as MemberInfo, provide information about a CLR type and its usage.

若要扩展 XAML 类型系统,可以从 XamlType派生。To extend the XAML type system, you can derive from XamlType. 为了有效地执行此操作,你可能还需要实现 XamlTypeInvokerTo do so effectively, you might also need to implement a XamlTypeInvoker. XamlTypeInvoker 使通用化 XAML 类型系统能够与指定为调用行为一部分的类型系统支持一起工作。The XamlTypeInvoker enables the generalized XAML type system to work with the type system backing that you specify as part of the invocation behavior. 特定的自定义 XamlTypeInvoker 提供了一种方法来减少 CLR 类型系统上的依赖项,这些依赖项由默认 XamlType 行为使用。The specific custom XamlTypeInvoker provides a way to reduce the dependencies on the CLR type system, which are used by the default XamlType behavior.

构造函数

XamlType(String, IList<XamlType>, XamlSchemaContext)

基于类型的字符串名称初始化 XamlType 类的新实例。Initializes a new instance of the XamlType class based on a string name for the type.

XamlType(String, String, IList<XamlType>, XamlSchemaContext)

基于 XAML 命名空间和类型的字符串名称初始化 XamlType 类的新实例。Initializes a new instance of the XamlType class based on the XAML namespace and a string name for the type. 此构造函数专用于已知在支持类型系统和 XAML 架构上下文中,没有支持的类型用法的分析和 XAML 节点记录。This constructor is exclusively for analysis and XAML-node recording of type usages that are known to not have backing in the supporting type system and XAML schema context.

XamlType(Type, XamlSchemaContext)

基于基础 CLR 类型信息初始化 XamlType 类的新实例。Initializes a new instance of the XamlType class based on the underlying CLR type information.

XamlType(Type, XamlSchemaContext, XamlTypeInvoker)

基于基础类型信息和 XamlType 实现初始化 XamlTypeInvoker 类的新实例。Initializes a new instance of the XamlType class based on underlying type information and a XamlTypeInvoker implementation.

属性

AllowedContentTypes

获取类型的只读集合,这些类型可用作此 ContentPropertyXamlType 值。Gets a read-only collection of the types that are usable as the ContentProperty value for this XamlType.

BaseType

获取此 XAML 类型的直接基类型的 XamlTypeGets the XamlType for the immediate base type of this XAML type. 将基于此 XamlType 的基础类型和架构上下文来确定此值。Determination of this value is based on the underlying type of this XamlType and schema context.

ConstructionRequiresArguments

获取一个值,该值指示此 XamlType 是否必须具有参数(通过 x:TypeArguments 实现的泛型约束、初始化文本或其他 XAML 技术)才能构造有效的类型实例。Gets a value that indicates whether this XamlType must have arguments (generic constraints through x:TypeArguments, initialization text, or other XAML techniques) to construct a valid instance of the type.

ContentProperty

获取此 XamlMember 的内容属性的 XamlType 信息。Gets the XamlMember information for the content property of this XamlType.

ContentWrappers

获取用于在内容属性不是严格类型匹配时包装其内容的类型,例如强类型 Collection<T> 中的字符串。Gets the types that are used to wrap content for a content property when it is not a strict type match, such as strings in a strongly typed Collection<T>.

DeferringLoader

获取 XamlValueConverter<TConverterBase>,它表示此类型的延迟加载转换行为。Gets the XamlValueConverter<TConverterBase> that represents the deferred loading conversion behavior for this type.

Invoker

获取与此 XamlTypeInvoker 关联的 XamlType 实现。Gets the XamlTypeInvoker implementation that is associated with this XamlType.

IsAmbient

获取一个值,该值指示此 XamlType 按照 XAML 定义是否表示环境类型。Gets a value that indicates whether this XamlType represents an ambient type, as per the XAML definition.

IsArray

获取一个值,该值指示此 XamlType 是否表示数组。Gets a value that indicates whether this XamlType represents an array.

IsCollection

获取一个值,该值指示此 XamlType 是否表示集合。Gets a value that indicates whether this XamlType represents a collection.

IsConstructible

获取一个值,该值指示此 XamlType 按照 XAML 定义是否表示可构造类型。Gets a value that indicates whether this XamlType represents a constructible type, as per the XAML definition.

IsDictionary

获取一个值,该值指示此 XamlType 按照 XAML 定义是否表示字典。Gets a value that indicates whether this XamlType represents a dictionary, as per the XAML definition.

IsGeneric

获取一个值,该值指示此 XamlType 是否表示泛型类型。Gets a value that indicates whether this XamlType represents a generic type.

IsMarkupExtension

获取一个值,该值指示此 XamlType 是否表示标记扩展。Gets a value that indicates whether this XamlType represents a markup extension.

IsNameScope

获取一个值,该值指示此 XamlType 按照 XAML 定义是否表示 XAML 名称范围。Gets a value that indicates whether this XamlType represents a XAML namescope, as per the XAML definition.

IsNameValid

获取一个值,该值指示是否使用有效的 XamlType 字符串作为其 xamlName 来初始化此 NameGets a value that indicates whether this XamlType is initialized by using a valid xamlName string as its Name.

IsNullable

获取一个值,该值指示此 XamlType 按照 XAML 定义是否表示可以为 null 的类型。Gets a value that indicates whether this XamlType represents a nullable type, as per the XAML definition.

IsPublic

获取一个值,该值指示此 XamlType 是否表示相关类型系统中的公共类型。Gets a value that indicates whether this XamlType represents a public type in the relevant type system.

IsUnknown

获取一个值,该值指示此 XamlType 是否表示无法在基础类型系统中解析的类型。Gets a value that indicates whether this XamlType represents a type that cannot be resolved in the underlying type system.

IsUsableDuringInitialization

获取一个值,该值指示在 XAML 初始化过程中是否自上而下生成此 XamlTypeGets a value that indicates whether this XamlType is built top-down during XAML initialization.

IsWhitespaceSignificantCollection

获取一个值,该值指示此 XamlType 按照 XML 定义是否表示空白有意义集合。Gets a value that indicates whether this XamlType represents a whitespace significant collection, as per the XML definition.

IsXData

获取一个值,该值指示此 XamlType 按照 XAML 定义是否表示 XML XDATAGets a value that indicates whether this XamlType represents XML XDATA, as per the XAML definition.

ItemType

获取一个值,该值为此 ItemsXamlType 属性提供类型信息。Gets a value that provides the type information for the Items property of this XamlType.

KeyType

如果 XamlType 表示字典,则获取一个值,该值为此 XamlType 的键属性提供类型信息。Gets a value that provides the type information for the key property of this XamlType, if the XamlType represents a dictionary.

MarkupExtensionReturnType

如果此 ProvideValue 表示标记扩展,则获取一个为其已返回的 XamlType 提供类型信息的值。Gets a value that provides the type information for the returned ProvideValue of this XamlType, if it represents a markup extension.

Name

获取此 XamlType 表示的类型的字符串名称。Gets the string name of the type that this XamlType represents.

PreferredXamlNamespace

获取单个 XAML 命名空间,该命名空间是此 XamlType 的主 XAML 命名空间。Gets the single XAML namespace that is the primary XAML namespace for this XamlType.

SchemaContext

获取用于处理此 XamlSchemaContext 的活动 XamlTypeGets the active XamlSchemaContext for processing this XamlType.

TrimSurroundingWhitespace

获取一个值,该值指示此 XamlType 是否具有用于在其内容中修整周围空白的序列化空白处理行为。Gets a value that indicates whether this XamlType has whitespace handling behavior for serialization that trims the surrounding whitespace in its content.

TypeArguments

针对此 XamlType 表示泛型的情况获取类型参数的列表。Gets a list of type arguments for cases where this XamlType represents a generic.

TypeConverter

获取一个具有 XamlValueConverter<TConverterBase> 约束的 TypeConverter,该约束表示此 XamlType 的值的类型转换行为。Gets a XamlValueConverter<TConverterBase> with TypeConverter constraint that represents type conversion behavior for values of this XamlType.

UnderlyingType

获取为此 Type 提供支持的 CLR XamlTypeGets the CLR Type that underlies this XamlType.

ValueSerializer

获取具有 XamlValueConverter<TConverterBase> 约束的 ValueSerializer,该约束表示此 XamlType 的值的值序列化行为。Gets a XamlValueConverter<TConverterBase> with ValueSerializer constraint that represents value serialization behavior for values of this XamlType.

方法

CanAssignTo(XamlType)

返回一个值,该值指示此 XamlType 的实例在其可分配类型的列表中是否有指定的 XamlTypeReturns a value that indicates whether an instance of this XamlType has the specified XamlType in its list of assignable types.

Equals(Object)

指示当前对象是否等于另一个对象。Indicates whether the current object is equal to another object.

Equals(XamlType)

指示当前对象是否等于同一类型的另一个对象。Indicates whether the current object is equal to another object of the same type.

GetAliasedProperty(XamlDirective)

返回由此 XamlType 将其别名设置为 XAML 指令的 XAML 成员。Returns the XAML member that is aliased to a XAML directive by this XamlType.

GetAllAttachableMembers()

返回一个集合,该集合包含由此 XamlType 公开的所有可附加的属性。Returns a collection that contains all the attachable properties that are exposed by this XamlType.

GetAllMembers()

返回一个集合,该集合包含由此 XamlType 公开的所有成员。Returns a collection that contains all the members that are exposed by this XamlType.

GetAttachableMember(String)

返回一个 XamlMember,表示此 XamlType 的一个命名的特定可附加成员。Returns a XamlMember representing a specific named attachable member of this XamlType.

GetHashCode()

返回此对象的哈希代码。Returns the hash code for this object.

GetMember(String)

从此 XamlMember 中返回特定命名成员的 XamlTypeReturns a XamlMember for a specific named member from this XamlType.

GetPositionalParameters(Int32)

对于标记扩展类型,返回此 XamlType 的特定标记扩展用法中所支持位置参数的类型。For markup extension types, returns the types of the positional parameters that are supported in a specific markup extension usage for this XamlType.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
GetXamlNamespaces()

为包括了类型的 XAML 命名空间返回字符串标识符的列表。Returns a list of string identifiers for XAML namespaces that the type is included in.

LookupAliasedProperty(XamlDirective)

返回由此 XamlType 将其别名设置为 XAML 指令的 XAML 成员。Returns the XAML member that is aliased to a XAML directive by this XamlType.

LookupAllAttachableMembers()

返回一个可枚举集合,该集合包含由此 XamlType 公开的所有可附加的属性。Returns an enumerable set that contains all attachable properties that are exposed by this XamlType.

LookupAllMembers()

返回一个可枚举集合,该集合包含由此 XamlType 公开的所有成员。Returns an enumerable set that contains all the members that are exposed by this XamlType.

LookupAllowedContentTypes()

返回类型的列表,这些类型可用作此 ContentPropertyXamlType 值。Returns a list of the types that are usable as the ContentProperty value for this XamlType.

LookupAttachableMember(String)

XamlMember 中特定的已命名可附加成员返回 XamlTypeReturns a XamlMember for a specific named attachable from this XamlType.

LookupBaseType()

返回此 XAML 类型的直接基类型的 XamlTypeReturns the XamlType for the immediate base type of this XAML type. 将基于此 XamlType 的基础类型和架构上下文来确定此值。Determination of this value is based on the underlying type of this XamlType and schema context.

LookupCollectionKind()

返回 XamlCollectionKind 枚举的一个值,该枚举声明此 XamlType 使用哪种特定集合类型。Returns a value of the XamlCollectionKind enumeration that declares which specific collection type this XamlType uses.

LookupConstructionRequiresArguments()

返回一个值,该值指示此 XamlType 是否必须具有参数(通过 x:TypeArguments 实现的泛型约束、初始化文本或其他 XAML 技术)才能构造有效的类型实例。Returns a value that indicates whether this XamlType must have arguments (generic constraints through x:TypeArguments, initialization text, or other XAML techniques) to construct a valid instance of the type.

LookupContentProperty()

返回此 XamlMember 的内容属性的 XamlType 信息。Returns XamlMember information for the content property of this XamlType.

LookupContentWrappers()

获取 XamlType 值的列表,这些值表示此 XamlType 的内容包装。Gets a list of XamlType values that represent the content wrappers for this XamlType.

LookupCustomAttributeProvider()

在派生类中实现时,返回 ICustomAttributeProvider 实现。When implemented in a derived class, returns an ICustomAttributeProvider implementation.

LookupDeferringLoader()

返回一个 XamlValueConverter<TConverterBase> 对象,该对象用于 XAML 声明的对象的延迟加载。Returns a XamlValueConverter<TConverterBase> object, which is used for deferred loading of XAML-declared objects.

LookupInvoker()

返回与此 XamlTypeInvoker 关联的 XamlTypeReturns a XamlTypeInvoker that is associated with this XamlType.

LookupIsAmbient()

返回一个值,该值指示此 XamlType 按照 XAML 定义是否表示环境类型。Returns a value that indicates whether this XamlType represents an ambient type, as per the XAML definition.

LookupIsConstructible()

返回一个值,该值指示此 XamlType 按照 XAML 定义是否表示可构造类型。Returns a value that indicates whether this XamlType represents a constructible type, as per the XAML definition.

LookupIsMarkupExtension()

返回一个值,该值指示此 XamlType 是否表示标记扩展。Returns a value that indicates whether this XamlType represents a markup extension.

LookupIsNameScope()

返回一个值,该值指示此 XamlType 按照 XAML 定义是否表示 XAML 名称范围。Returns a value that indicates whether this XamlType represents a XAML namescope, as per the XAML definition.

LookupIsNullable()

返回一个值,该值指示此 XamlType 按照 XAML 定义是否表示可以为 null 的类型。Returns a value that indicates whether this XamlType represents a nullable type, as per the XAML definition.

LookupIsPublic()

返回一个值,该值指示此 XamlType 是否表示相关类型系统中的公共类型。Returns a value that indicates whether this XamlType represents a public type in the relevant type system.

LookupIsUnknown()

返回一个值,该值指示此 XamlType 是否表示无法在基础类型系统中解析的类型。Returns a value that indicates whether this XamlType represents a type that cannot be resolved in the underlying type system.

LookupIsWhitespaceSignificantCollection()

返回一个值,该值指示此 XamlType 按照 XML 定义是否表示空白有意义集合。Returns a value that indicates whether this XamlType represents a whitespace significant collection, as per the XML definition.

LookupIsXData()

返回一个值,该值指示此 XamlType 按照 XAML 定义是否表示 XML XDATAReturns a value that indicates whether this XamlType represents XML XDATA, as per the XAML definition.

LookupItemType()

返回一个值,该值为此 ItemsXamlType 属性提供类型信息。Returns a value that provides the type information for the Items property of this XamlType.

LookupKeyType()

如果 XamlType 表示字典,则返回一个值,该值为此 XamlType 的键属性提供类型信息。Returns a value that provides the type information for the key property of this XamlType, if the XamlType represents a dictionary.

LookupMarkupExtensionReturnType()

如果此 ProvideValue 表示标记扩展,则返回一个为其已返回的 XamlType 提供类型信息的值。Returns a value that provides the type information for the returned ProvideValue of this XamlType, if it represents a markup extension.

LookupMember(String, Boolean)

从此 XamlMember 中返回特定命名成员的 XamlTypeReturns the XamlMember for a specific named member from this XamlType.

LookupPositionalParameters(Int32)

对于标记扩展类型,返回此 XamlType 的特定标记扩展用法中所支持位置参数的类型。For markup extension types, returns the types of the positional parameters that are supported in a specific markup extension usage for this XamlType.

LookupSetMarkupExtensionHandler()

返回一个用于标记扩展的 set 操作的处理程序回调。Returns a handler callback to use for the set operations of markup extensions.

LookupSetTypeConverterHandler()

返回一个用于类型转换器设置情况的处理程序。Returns a handler to use for type converter setting cases.

LookupTrimSurroundingWhitespace()

返回一个值,该值指示此 XamlType 是否应使用修整周围空白的模式进行序列化。Returns a value that indicates whether this XamlType should be serialized using a mode that trims surrounding whitespace.

LookupTypeConverter()

返回具有 XamlValueConverter<TConverterBase> 约束的 TypeConverter,该约束表示此 XamlType 的值的类型转换行为。Returns a XamlValueConverter<TConverterBase> that has a TypeConverter constraint, which represents type-conversion behavior for values of this XamlType.

LookupUnderlyingType()

返回为此 Type 提供支持的 CLR XamlTypeReturns the CLR Type that underlies this XamlType.

LookupUsableDuringInitialization()

返回一个值,该值指示在 XAML 初始化过程中是否自上而下生成此 XamlTypeReturns a value that indicates whether this XamlType is built top-down during XAML initialization.

LookupValueSerializer()

返回具有 XamlValueConverter<TConverterBase> 约束的 ValueSerializer,该约束表示此 XamlType 的值的值序列化行为。Returns a XamlValueConverter<TConverterBase> that has a ValueSerializer constraint, which represents value serialization behavior for values of this XamlType.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回此 XamlType 的字符串表示形式。Returns a string representation of this XamlType.

运算符

Equality(XamlType, XamlType)

确定两个指定的 XamlType 对象是否具有相同的值。Determines whether two specified XamlType objects have the same value.

Inequality(XamlType, XamlType)

确定两个指定的 XamlType 对象是否具有不同的值。Determines whether two specified XamlType objects have different values.

适用于