XamlMember XamlMember XamlMember XamlMember Class

定義

提供 XAML 型別成員的 XAML 型別系統識別項。Provides the XAML type system identifier for members of XAML types. 識別項會由 XAML 讀取器和 XAML 寫入器在處理成員節點期間 (當 XAML 讀取器定位於上StartMember) 以及一般 XAML 型別系統邏輯。The identifier is used by XAML readers and XAML writers during processing of member nodes (when the XAML reader is positioned on a StartMember) and also for general XAML type system logic.

public ref class XamlMember : IEquatable<System::Xaml::XamlMember ^>
public class XamlMember : IEquatable<System.Xaml.XamlMember>
type XamlMember = class
    interface IEquatable<XamlMember>
Public Class XamlMember
Implements IEquatable(Of XamlMember)
繼承
XamlMemberXamlMemberXamlMemberXamlMember
衍生
實作

備註

XamlMember 可以使用三個方法,傳回 XAML 成員的相關資訊: 標準 common language runtime (CLR) 反映;參考僅限反映技術,呼叫內部 Api 的使用最佳化的位元旗標;或虛擬呼叫覆寫Lookup*儘可能提供的 APIXamlMember子類別。XamlMember can use three methodologies for returning information about a XAML member: standard common language runtime (CLR) reflection; a reference-only reflection technique calling internal APIs that use optimized bit flags; or calling into virtual overrides of the Lookup* API that is provided by possible XamlMember subclasses. 用於大部分的用途,.NET Framework XAML 服務 api 和XamlMemberAPI,您會使用預設 XAML 結構描述內容。For most uses of .NET Framework XAML Services APIs and the XamlMember API, you use the default XAML schema context. .NET Framework XAML 服務的預設 XAML 結構描述內容會使用 CLR 型別系統支援。The default XAML schema context for .NET Framework XAML Services uses CLR backing for the type system. 這可讓 XAML 讀取器和 XAML 寫入器來處理任何類型或成員定義中,或其他可、 CLR 和其反映技術。This enables the XAML readers and XAML writers to work with any type or member that is defined in, or otherwise available to, the CLR and its reflection techniques.

查閱 * Api 和 XamlMember 衍生的類別Lookup* APIs and XamlMember Derived Classes

XamlMember 定義數個虛擬的衍生類別的成員可能會覆寫。XamlMember defines several virtual members that derived classes might override. 這些成員具有永遠以字串為開頭的名稱LookupThese members have names that always start with the string Lookup. API 的其餘部分的名稱然後參考虛擬方法影響的屬性。The remainder of the API name then references the property that the virtual method influences. 例如,XamlMember衍生的類別可能會覆寫LookupTargetType影響哪些基底定義的屬性TargetType傳回衍生類別中。For example, a XamlMember derived class might override LookupTargetType to influence what the base-defined property TargetType returns in a derived class. 您可以預測中這類屬性的傳回值XamlMember或現有的衍生類別,請閱讀相關的文件Lookup*方法。You can predict return values for such properties in XamlMember or existing derived classes by reading the documentation for the relevant Lookup* methods.

目的Lookup*方法是提供 XAML 類型系統擴充技術,其中包含XamlMember基底類別。The purpose of the Lookup* methods is to provide a XAML type system extension technique that incorporates the XamlMember base class. 藉由衍生自XamlMember,並覆寫Lookup虛擬成員,您可以定義的 XAML 結構描述的 XAML 成員的概念,XAML 類型系統中而不必受限於支援型別系統或技術的細節。By deriving from XamlMember and overriding the Lookup virtual members, you can define the concept of a XAML member for a XAML schema in a XAML type system without being tied to the specifics of a backing type system or technology. 您可以也使用提供的 XAML 結構描述內容在此配置下,並仍會傳回您想要的結果。You can also use a provided XAML schema context under this scheme and still return the results you want.

例如,請考慮XamlMember屬性IsWritePublicAs an example, consider the XamlMember property IsWritePublic. 這個屬性就會通知呼叫端,該作業,例如使用XamlWriter序列化可以寫入此成員值的目標物件上。This property informs callers that operations such as using a XamlWriter for serialization can write a value for this member on a target object. 在預設實作中,該成員是否可寫入的判定由使用反映技術的支援 CLRType和其成員 ( MemberInfo)。In the default implementation, the determination of whether the member is writable is made by using reflection techniques against the backing CLR Type and its members (the MemberInfo). 因此,根據預設,XAML 類型系統取決於 CLR 型別系統。Therefore, by default, the XAML type system depends on the CLR type system. 不過,您可以移除此相依性,您 XAML 類型系統報告IsWritePublic藉由覆寫 API LookupIsWritePublicHowever, you can remove this dependency for your XAML type system reporting of IsWritePublic by overriding the API LookupIsWritePublic. 在您的覆寫中,您可以使用其他的決定,例如您的技術,主要的查閱資料表中的可寫入的 XAML 成員是否適合用於固定的 XAML 詞彙或各種其他策略來判斷特定的中繼資料程式XAML 的詞彙。Within your override, you can use other determinations, such as metadata that is specific to your technology, a master lookup table that is optimized for a fixed XAML vocabulary, or a variety of other strategies for determining whether a XAML member is writable in your XAML vocabulary.

建構 XamlMember 沒有 XAML 結構描述內容Constructing XamlMember Without XAML Schema Context

大部分的建構函式的XamlMember需要XamlSchemaContext做為其初始化的一部分。Most constructors of XamlMember require a XamlSchemaContext as part of their initialization. XamlSchemaContext也是必要的許多內部XamlSchemaContext作業,例如取得轉寄從支援類型的資訊。The XamlSchemaContext is also necessary for many internal XamlSchemaContext operations, such as obtaining information that is being forwarded from the backing type. 當您正在使用XamlMemberAPI,您通常必須XamlSchemaContext就可以從周圍建構這類XamlWriterWhen you are working with the XamlMember API, you typically have a XamlSchemaContext that is available from a surrounding construct such as a XamlWriter. 在此情況下,您可以傳遞XamlSchemaContext參考透過 XAML 類型系統的所有呼叫需要 XAML 結構描述內容。In this case, you can pass the XamlSchemaContext reference through to all XAML type system calls that require a XAML schema context.

一個特定建構函式, XamlMember(String, XamlType, Boolean),不需要XamlSchemaContextOne specific constructor, XamlMember(String, XamlType, Boolean), does not require a XamlSchemaContext. 不過,XamlMember建構XamlMember(String, XamlType, Boolean)簽章會傳回trueIsUnknownHowever, a XamlMember that is constructed with the XamlMember(String, XamlType, Boolean) signature returns true for IsUnknown.

適用於牽涉到的載入路徑XamlObjectWriter,這類成員無法寫入物件圖形。For a load path that involves XamlObjectWriter, such a member cannot be written into an object graph. 使用.NET Framework XAML 服務實作中,XamlObjectWriter.WriteStartMember呼叫會擲回XamlObjectWriterException時的相關XamlMember報告trueIsUnknownUsing the .NET Framework XAML services implementation, the XamlObjectWriter.WriteStartMember call throws a XamlObjectWriterException when the relevant XamlMember reports true for IsUnknown.

您不應該建構XamlMember,其值為trueforIsUnknown除非您的實作可以處理的例外狀況,從XamlObjectWriter,或您可以透過其他方式調整XamlObjectWriter行為。You should not construct a XamlMember that has a value of true for IsUnknown unless your implementation can handle the exceptions from XamlObjectWriter, or you have other ways to adjust the XamlObjectWriter behavior. 比方說,一或多個項目可能是實作的您,則為 true:For example, one or more of the following might be true of your implementation:

建構函式

XamlMember(EventInfo, XamlSchemaContext) XamlMember(EventInfo, XamlSchemaContext) XamlMember(EventInfo, XamlSchemaContext) XamlMember(EventInfo, XamlSchemaContext)

初始化的新執行個體XamlMember類別使用 CLR 型別系統EventInfoXamlSchemaContextInitializes a new instance of the XamlMember class using CLR type system EventInfo and a XamlSchemaContext.

XamlMember(EventInfo, XamlSchemaContext, XamlMemberInvoker) XamlMember(EventInfo, XamlSchemaContext, XamlMemberInvoker) XamlMember(EventInfo, XamlSchemaContext, XamlMemberInvoker) XamlMember(EventInfo, XamlSchemaContext, XamlMemberInvoker)

初始化的新執行個體XamlMember類別使用 CLR 型別系統EventInfoXamlSchemaContext,其中包括XamlMemberInvoker資訊。Initializes a new instance of the XamlMember class using CLR type system EventInfo and a XamlSchemaContext, including XamlMemberInvoker information.

XamlMember(PropertyInfo, XamlSchemaContext) XamlMember(PropertyInfo, XamlSchemaContext) XamlMember(PropertyInfo, XamlSchemaContext) XamlMember(PropertyInfo, XamlSchemaContext)

初始化的新執行個體XamlMember類別使用 CLR 型別系統PropertyInfoXamlSchemaContextInitializes a new instance of the XamlMember class using CLR type system PropertyInfo and a XamlSchemaContext.

XamlMember(PropertyInfo, XamlSchemaContext, XamlMemberInvoker) XamlMember(PropertyInfo, XamlSchemaContext, XamlMemberInvoker) XamlMember(PropertyInfo, XamlSchemaContext, XamlMemberInvoker) XamlMember(PropertyInfo, XamlSchemaContext, XamlMemberInvoker)

初始化的新執行個體XamlMember類別使用反映PropertyInfoXamlSchemaContext,其中包括XamlMemberInvoker資訊。Initializes a new instance of the XamlMember class using reflection PropertyInfo and a XamlSchemaContext, including XamlMemberInvoker information.

XamlMember(String, MethodInfo, MethodInfo, XamlSchemaContext) XamlMember(String, MethodInfo, MethodInfo, XamlSchemaContext) XamlMember(String, MethodInfo, MethodInfo, XamlSchemaContext) XamlMember(String, MethodInfo, MethodInfo, XamlSchemaContext)

初始化的新執行個體XamlMember類別的XamlMember表示可附加屬性。Initializes a new instance of the XamlMember class for a XamlMember that represents an attachable property.

XamlMember(String, MethodInfo, MethodInfo, XamlSchemaContext, XamlMemberInvoker) XamlMember(String, MethodInfo, MethodInfo, XamlSchemaContext, XamlMemberInvoker) XamlMember(String, MethodInfo, MethodInfo, XamlSchemaContext, XamlMemberInvoker) XamlMember(String, MethodInfo, MethodInfo, XamlSchemaContext, XamlMemberInvoker)

初始化的新執行個體XamlMember類別XamlMember表示可附加屬性,包括XamlMemberInvoker資訊。Initializes a new instance of the XamlMember class for a XamlMember that represents an attachable property, including XamlMemberInvoker information.

XamlMember(String, MethodInfo, XamlSchemaContext) XamlMember(String, MethodInfo, XamlSchemaContext) XamlMember(String, MethodInfo, XamlSchemaContext) XamlMember(String, MethodInfo, XamlSchemaContext)

初始化的新執行個體XamlMember類別的XamlMember表示可附加事件。Initializes a new instance of the XamlMember class for a XamlMember that represents an attachable event.

XamlMember(String, MethodInfo, XamlSchemaContext, XamlMemberInvoker) XamlMember(String, MethodInfo, XamlSchemaContext, XamlMemberInvoker) XamlMember(String, MethodInfo, XamlSchemaContext, XamlMemberInvoker) XamlMember(String, MethodInfo, XamlSchemaContext, XamlMemberInvoker)

初始化的新執行個體XamlMember類別XamlMember,表示可附加事件,包括XamlMemberInvoker資訊。Initializes a new instance of the XamlMember class for a XamlMember that represents an attachable event, including XamlMemberInvoker information.

XamlMember(String, XamlType, Boolean) XamlMember(String, XamlType, Boolean) XamlMember(String, XamlType, Boolean) XamlMember(String, XamlType, Boolean)

初始化的新執行個體XamlMember類別使用的字串名稱,以及宣告XamlType資訊。Initializes a new instance of the XamlMember class using a string name and declaring XamlType information. 使用此簽章建構的 XamlMember 具有諸多限制。A XamlMember that is constructed with this signature has significant limitations.

屬性

DeclaringType DeclaringType DeclaringType DeclaringType

取得XamlType宣告與此相關聯之成員的型別為XamlMemberGets the XamlType for the type that declares the member that is associated with this XamlMember.

DeferringLoader DeferringLoader DeferringLoader DeferringLoader

取得XamlValueConverter<TConverterBase>物件用於延後載入 XAML 宣告的物件。Gets a XamlValueConverter<TConverterBase> object, which is used for deferred loading of XAML declared objects.

DependsOn DependsOn DependsOn DependsOn

取得 XamlMember 物件的清單。Gets a list of XamlMember objects. 這些物件會報告相對於這個初始設定順序的相依性關聯性的所在的成員XamlMemberThese report the members where dependency relationships for initialization order exist relative to this XamlMember.

Invoker Invoker Invoker Invoker

取得XamlMemberInvoker相關聯,以此方式實作XamlMemberGets the XamlMemberInvoker implementation that is associated with this XamlMember.

IsAmbient IsAmbient IsAmbient IsAmbient

取得值,指出是否此XamlMember報告為環境屬性。Gets a value that indicates whether this XamlMember is reported as an ambient property.

IsAttachable IsAttachable IsAttachable IsAttachable

取得值,指出是否此XamlMember是可附加的成員。Gets a value that indicates whether this XamlMember is an attachable member.

IsDirective IsDirective IsDirective IsDirective

取得值,指出是否此XamlMember是 XAML 指示詞。Gets a value that indicates whether this XamlMember is a XAML directive.

IsEvent IsEvent IsEvent IsEvent

取得值,指出是否此XamlMember表示事件成員。Gets a value that indicates whether this XamlMember represents an event member.

IsNameValid IsNameValid IsNameValid IsNameValid

取得值,指出是否這XamlMember初始化的有效xamlName字串做為其NameGets a value that indicates whether this XamlMember is initialized with a valid xamlName string as its Name.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

取得值,指出是否此XamlMember表示唯讀成員。Gets a value that indicates whether this XamlMember represents a read-only member.

IsReadPublic IsReadPublic IsReadPublic IsReadPublic

取得值,指出是否這XamlMember表示具有可呼叫的公用成員get存取子。Gets a value that indicates whether this XamlMember represents a member with a callable public get accessor.

IsUnknown IsUnknown IsUnknown IsUnknown

取得值,指出是否在成員不是解析用於型別和成員解析的支援系統。Gets a value that indicates whether the member is not resolvable by the backing system that is used for type and member resolution.

IsWriteOnly IsWriteOnly IsWriteOnly IsWriteOnly

取得值,指出是否此XamlMember表示唯寫的成員。Gets a value that indicates whether this XamlMember represents a write-only member.

IsWritePublic IsWritePublic IsWritePublic IsWritePublic

取得值,指出是否這XamlMember表示具有可呼叫的公用成員set存取子。Gets a value that indicates whether this XamlMember represents a member that has a callable public set accessor.

MarkupExtensionBracketCharacters MarkupExtensionBracketCharacters MarkupExtensionBracketCharacters MarkupExtensionBracketCharacters

定義標記延伸的左右括弧字元。Defines the opening and closing bracket characters for a markup extension.

Name Name Name Name

取得xamlName名稱字串,其中宣告此XamlMemberGets the xamlName name string that declares this XamlMember.

PreferredXamlNamespace PreferredXamlNamespace PreferredXamlNamespace PreferredXamlNamespace

取得單一 XAML 命名空間 URI,這個識別主要 XAML 命名空間XamlMemberGets the single XAML namespace URI that identifies the primary XAML namespace for this XamlMember.

SerializationVisibility SerializationVisibility SerializationVisibility SerializationVisibility

取得DesignerSerializationVisibility值,表示視覺化設計工具應該如何處理該成員。Gets a DesignerSerializationVisibility value, which indicates how a visual designer should process the member.

TargetType TargetType TargetType TargetType

取得XamlType型別的其中XamlMember可以存在。Gets the XamlType of the type where the XamlMember can exist.

Type Type Type Type

取得XamlType正由成員的類型。Gets the XamlType of the type that is used by the member.

TypeConverter TypeConverter TypeConverter TypeConverter

取得XamlValueConverter<TConverterBase>物件,可讓您以型別轉換建構 XAML 宣告的物件。Gets a XamlValueConverter<TConverterBase> object, which can be used for type conversion construction of XAML declared objects.

UnderlyingMember UnderlyingMember UnderlyingMember UnderlyingMember

取得 CLR 型別系統MemberInfo可用的成員,來建構PropertyInfoMethodInfo,或EventInfoGets the CLR type system MemberInfo that is available for a member that is constructed by PropertyInfo, MethodInfo, or EventInfo.

ValueSerializer ValueSerializer ValueSerializer ValueSerializer

取得XamlValueConverter<TConverterBase>物件,用於 XAML 宣告的物件值序列化。Gets a XamlValueConverter<TConverterBase> object, which is used for value serialization of XAML declared objects.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

指出目前的物件是否等於另一個物件。Indicates whether the current object is equal to another object.

Equals(XamlMember) Equals(XamlMember) Equals(XamlMember) Equals(XamlMember)

指出目前的物件是否等於另一個相同類型的物件。Indicates whether the current object is equal to another object of the same type.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

傳回這個物件的雜湊程式碼。Returns the hash code for this object.

GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
GetXamlNamespaces() GetXamlNamespaces() GetXamlNamespaces() GetXamlNamespaces()

傳回這個 XAML 成員可以存在的位置的 XAML 命名空間的清單。Returns a list of XAML namespaces where this XAML member can exist.

LookupCustomAttributeProvider() LookupCustomAttributeProvider() LookupCustomAttributeProvider() LookupCustomAttributeProvider()

在衍生類別中實作時,會傳回ICustomAttributeProvider實作。When implemented in a derived class, returns an ICustomAttributeProvider implementation.

LookupDeferringLoader() LookupDeferringLoader() LookupDeferringLoader() LookupDeferringLoader()

傳回XamlValueConverter<TConverterBase>物件用於延後載入 XAML 宣告的物件。Returns a XamlValueConverter<TConverterBase> object, which is used for deferred loading of XAML declared objects.

LookupDependsOn() LookupDependsOn() LookupDependsOn() LookupDependsOn()

傳回一份XamlMember物件。Returns a list of XamlMember objects. 在清單中的項目報告相對於這個初始設定順序的相依性關聯性的所在的成員XamlMemberItems in the list report the members where dependency relationships for initialization order exist relative to this XamlMember.

LookupInvoker() LookupInvoker() LookupInvoker() LookupInvoker()

傳回XamlMemberInvoker與此相關聯XamlMemberReturns a XamlMemberInvoker that is associated with this XamlMember.

LookupIsAmbient() LookupIsAmbient() LookupIsAmbient() LookupIsAmbient()

傳回是否這XamlMember報告為環境屬性。Returns whether this XamlMember is reported as an ambient property.

LookupIsEvent() LookupIsEvent() LookupIsEvent() LookupIsEvent()

傳回是否這XamlMember代表的事件。Returns whether this XamlMember represents an event.

LookupIsReadOnly() LookupIsReadOnly() LookupIsReadOnly() LookupIsReadOnly()

傳回是否這XamlMember代表所需的唯讀屬性。Returns whether this XamlMember represents an intended read-only property.

LookupIsReadPublic() LookupIsReadPublic() LookupIsReadPublic() LookupIsReadPublic()

傳回是否這XamlMember表示具有公用的屬性get存取子。Returns whether this XamlMember represents a property that has a public get accessor.

LookupIsUnknown() LookupIsUnknown() LookupIsUnknown() LookupIsUnknown()

傳回是否這XamlMember表示不能解析用於型別和成員解析的支援系統的成員。Returns whether this XamlMember represents a member that is not resolvable by the backing system that is used for type and member resolution.

LookupIsWriteOnly() LookupIsWriteOnly() LookupIsWriteOnly() LookupIsWriteOnly()

傳回是否這XamlMember表示具有公用成員set存取子但沒有公用get存取子。Returns whether this XamlMember represents a member that has a public set accessor but not a public get accessor.

LookupIsWritePublic() LookupIsWritePublic() LookupIsWritePublic() LookupIsWritePublic()

傳回是否這XamlMember表示具有公用成員set存取子。Returns whether this XamlMember represents a member that has a public set accessor.

LookupMarkupExtensionBracketCharacters() LookupMarkupExtensionBracketCharacters() LookupMarkupExtensionBracketCharacters() LookupMarkupExtensionBracketCharacters()

傳回標記延伸的左右括弧字元。Returns the opening and closing bracket characters for a markup extension.

LookupTargetType() LookupTargetType() LookupTargetType() LookupTargetType()

傳回XamlType型別的其中XamlMember可以存在。Returns the XamlType of the type where the XamlMember can exist.

LookupType() LookupType() LookupType() LookupType()

傳回XamlType正由成員的類型。Returns the XamlType of the type that is used by the member.

LookupTypeConverter() LookupTypeConverter() LookupTypeConverter() LookupTypeConverter()

傳回與此相關聯的型別轉換子實作XamlMemberReturns a type converter implementation that is associated with this XamlMember.

LookupUnderlyingGetter() LookupUnderlyingGetter() LookupUnderlyingGetter() LookupUnderlyingGetter()

傳回get存取子,這與相關聯XamlMemberReturns a get accessor that is associated with this XamlMember.

LookupUnderlyingMember() LookupUnderlyingMember() LookupUnderlyingMember() LookupUnderlyingMember()

傳回 CLR 型別系統MemberInfo與此相關聯XamlMemberReturns a CLR type system MemberInfo that is associated with this XamlMember.

LookupUnderlyingSetter() LookupUnderlyingSetter() LookupUnderlyingSetter() LookupUnderlyingSetter()

傳回set存取子,這與相關聯XamlMemberReturns a set accessor that is associated with this XamlMember.

LookupValueSerializer() LookupValueSerializer() LookupValueSerializer() LookupValueSerializer()

傳回與此相關聯的值序列化程式實作XamlMemberReturns a value serializer implementation that is associated with this XamlMember.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

傳回的字串表示,這個XamlMemberReturns a string representation of this XamlMember.

運算子

Equality(XamlMember, XamlMember) Equality(XamlMember, XamlMember) Equality(XamlMember, XamlMember) Equality(XamlMember, XamlMember)

判斷兩個指定的 XamlMember 物件是否具有相同的值。Determines whether two specified XamlMember objects have the same value.

Inequality(XamlMember, XamlMember) Inequality(XamlMember, XamlMember) Inequality(XamlMember, XamlMember) Inequality(XamlMember, XamlMember)

判斷兩個指定的 XamlMember 物件是否具有不同的值。Determines whether two specified XamlMember objects have different values.

適用於

另請參閱