共用方式為


SPContentTypeId.Equality operator

會指出是否等於兩個指定的內容類型識別碼 (Id)。

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
Public Shared Operator = ( _
    id1 As SPContentTypeId, _
    id2 As SPContentTypeId _
) As Boolean
'用途
Dim id1 As SPContentTypeId
Dim id2 As SPContentTypeId
Dim returnValue As Boolean

returnValue = (id1 = id2)
public static bool operator ==(
    SPContentTypeId id1,
    SPContentTypeId id2
)

參數

傳回值

Type: System.Boolean
true如果兩個值相同 ;否則false。

備註

SPContentTypeId結構實作IComparable介面。此方法會實作相等運算子。若要呼叫此方法,使用equality運算子具有兩個SPContentTypeId物件,如下列範例所示。

SPContentTypeId x = SPBuiltInContentTypeId.Item;
SPContentTypeId y = x;
Console.WriteLine(x == y); // True
Dim x As SPContentTypeId = SPBuiltInContentTypeId.Item
Dim y As SPContentTypeId = x
Console.WriteLine(x Is y) ' True

請參閱

參照

SPContentTypeId structure

SPContentTypeId members

Microsoft.SharePoint namespace

其他資源

Content Type IDs

Introduction to Content Types

Site and List Content Types

Base Content Type Hierarchy