TypeRef.IsAssignableFrom(TypeRef) 方法

定義

檢查指定的 TypeRef 所表示的類型是否可以指派給此實例所代表的類型。Checks if the type represented by the given TypeRef can be assigned to the type represented by this instance.

public bool IsAssignableFrom (Microsoft.VisualStudio.Composition.Reflection.TypeRef other);
member this.IsAssignableFrom : Microsoft.VisualStudio.Composition.Reflection.TypeRef -> bool
Public Function IsAssignableFrom (other As TypeRef) As Boolean

參數

other
TypeRef

要比較的 TypeRefTypeRef to compare to

傳回

Boolean

如果指定的 TypeRef 可以指派給這個實例,則為 true,否則為 false。true if the given TypeRef can be assigned to this instance, false otherwise.

備註

Xaml 檢查是藉由將指定的 TypeRef 的所有基底型別和介面,檢查它們是否等於這個實例來完成。The assignability check is done by traversing all the base types and interfaces of the given TypeRef to check if any of them are equal to this instance. 如果失敗,則會要求 CLR 檢查將會觸發元件載入的 xaml。Should that fail, the CLR is asked to check for assignability which will trigger an assembly load.

適用於