共用方式為


IVsDataObjectMemberComparer.Compare 方法 (String, String, Object, Object)

當由類別實作時,資料物件的屬性與另一個資料物件的屬性相比較。

命名空間:  Microsoft.VisualStudio.Data.Services.SupportEntities
組件:  Microsoft.VisualStudio.Data.Services (在 Microsoft.VisualStudio.Data.Services.dll 中)

語法

'宣告
Function Compare ( _
    typeName As String, _
    propertyName As String, _
    value1 As Object, _
    value2 As Object _
) As Integer
int Compare(
    string typeName,
    string propertyName,
    Object value1,
    Object value2
)
int Compare(
    String^ typeName, 
    String^ propertyName, 
    Object^ value1, 
    Object^ value2
)
abstract Compare : 
        typeName:string * 
        propertyName:string * 
        value1:Object * 
        value2:Object -> int 
function Compare(
    typeName : String, 
    propertyName : String, 
    value1 : Object, 
    value2 : Object
) : int

參數

  • propertyName
    型別:System.String
    要比較的屬性名稱。

傳回值

型別:System.Int32
值小於零,如果識別項部分的指定值小於;零,如果識別項部分等於指定值,大於零的值,如果識別項部分大於指定值大於。

備註

這個方法應使用比較規則與資料來源相同確保正確的排序在用戶端上的物件。

.NET Framework 安全性

請參閱

參考

IVsDataObjectMemberComparer 介面

Compare 多載

Microsoft.VisualStudio.Data.Services.SupportEntities 命名空間