XmlSerializerVersionAttribute 類別

定義

表示序列化 (Serialization) 基礎結構已產生程式碼,而且在這項屬性 (Attribute) 套用至組件 (Assembly) 時,可重複使用此程式碼來提升效能。Signifies that the code was generated by the serialization infrastructure and can be reused for increased performance, when this attribute is applied to an assembly.

public ref class XmlSerializerVersionAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly)]
public sealed class XmlSerializerVersionAttribute : Attribute
type XmlSerializerVersionAttribute = class
    inherit Attribute
Public NotInheritable Class XmlSerializerVersionAttribute
Inherits Attribute
繼承
XmlSerializerVersionAttribute
屬性

備註

.NET Framework 的 XML 序列化基礎結構會動態產生已優化的 XmlSerializer 衍生,以序列化使用者定義的類型。The .NET Framework XML serialization infrastructure dynamically generates derivations of XmlSerializer that are optimized to serialize user-defined types. 序列化程式會儲存在可重複使用的元件中,以有效率地進行序列化。The serializers are stored in assemblies that can be reused for efficient serialization.

XmlSerializerVersionAttribute 屬性會儲存有關產生一組序列化程式之父元件的版本資訊。The XmlSerializerVersionAttribute attribute stores version information about the parent assembly for which a set of serializers is generated. 之後,當呼叫 XmlSerializer 的函式時,基礎結構會嘗試找出預先產生的元件。Later, when the XmlSerializer constructor is called, the infrastructure attempts to locate the pre-generated assembly. 如果基礎結構發現具有相符名稱的元件,就會載入元件,而且基礎結構會檢查 XmlSerializerVersionAttribute 找到的元件版本與父元件的目前版本是否相符。If the infrastructure finds an assembly with a matching name, the assembly is loaded and the infrastructure checks XmlSerializerVersionAttribute for a match between the found assembly's version and the current version of the parent assembly. 如果版本不相符,則不會使用找到的元件。If the version does not match, the found assembly is not used. 相反地,會針對序列化產生暫存元件。Instead, a temporary assembly is generated for the serialization.

建構函式

XmlSerializerVersionAttribute()

初始化 XmlSerializerVersionAttribute 類別的新執行個體。Initializes a new instance of the XmlSerializerVersionAttribute class.

XmlSerializerVersionAttribute(Type)

為指定的型別初始化 XmlSerializerVersionAttribute 類別的新執行個體。Initializes a new instance of the XmlSerializerVersionAttribute class for the specified type.

屬性

Namespace

取得或設定組件的 Common Language Runtime (CLR) 命名空間。Gets or sets the common language runtime (CLR) namespace of the assembly.

ParentAssemblyId

取得或設定父組件的識別 (Identity)。Gets or sets the identity of the parent assembly.

Type

取得或設定序列化程式要在其上運作的型別。Gets or sets the type that the serializer operates on.

TypeId

在衍生類別中實作時,取得這個 Attribute 的唯一識別碼。When implemented in a derived class, gets a unique identifier for this Attribute.

(繼承來源 Attribute)
Version

取得或設定組件的版本號碼。Gets or sets the assembly's version number.

方法

Equals(Object)

傳回值,這個值指出此執行個體是否與指定的物件相等。Returns a value that indicates whether this instance is equal to a specified object.

(繼承來源 Attribute)
GetHashCode()

傳回這個執行個體的雜湊碼。Returns the hash code for this instance.

(繼承來源 Attribute)
GetType()

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

(繼承來源 Object)
IsDefaultAttribute()

在衍生類別中覆寫時,表示這個執行個體的值是衍生類別的預設值。When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.

(繼承來源 Attribute)
Match(Object)

在衍生類別中覆寫時,會傳回值,表示這個執行個體是否等於指定物件。When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.

(繼承來源 Attribute)
MemberwiseClone()

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

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

明確介面實作

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

將一組名稱對應至一組對應的分派識別項 (Dispatch Identifier)。Maps a set of names to a corresponding set of dispatch identifiers.

(繼承來源 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

擷取物件的類型資訊,可以用來取得介面的類型資訊。Retrieves the type information for an object, which can be used to get the type information for an interface.

(繼承來源 Attribute)
_Attribute.GetTypeInfoCount(UInt32)

擷取物件提供的類型資訊介面數目 (0 或 1)。Retrieves the number of type information interfaces that an object provides (either 0 or 1).

(繼承來源 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

提供物件所公開的屬性和方法的存取權。Provides access to properties and methods exposed by an object.

(繼承來源 Attribute)

適用於