我正在尝试确定界面是否使用特定属性进行修饰.例如,我有以下界面:
<MyCustomAttribute()> _
Public Interface IMyInterface
Function Function1
Sub DeleteWorkflowInstanceMap(ByVal instanceId As Guid)
Sub InsertWorkflowInstanceMap(ByVal instanceId As Guid, ByVal aliasName As String)
End Interface
Run Code Online (Sandbox Code Playgroud)
如何确定IMyInterface是否使用MyCustomAttribute属性进行修饰?
甚至比GetCustomAttributesShared方法更好IsDefined:
Attribute.IsDefined(GetType(IMyInterface), GetType(MyCustomAttribute))
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1655 次 |
| 最近记录: |