vb.net – 如何确定某个类是否使用特定属性进行修饰
发布时间:2020-12-17 00:06:16 所属栏目:大数据 来源:网络整理
导读:我正在尝试确定界面是否使用特定属性进行修饰.例如,我有以下界面: MyCustomAttribute() _Public Interface IMyInterface Function Function1 Sub DeleteWorkflowInstanceMap(ByVal instanceId As Guid) Sub InsertWorkflowInstanceMap(ByVal instanceId As
我正在尝试确定界面是否使用特定属性进行修饰.例如,我有以下界面:
<MyCustomAttribute()> _ Public Interface IMyInterface Function Function1 Sub DeleteWorkflowInstanceMap(ByVal instanceId As Guid) Sub InsertWorkflowInstanceMap(ByVal instanceId As Guid,ByVal aliasName As String) End Interface 如何确定IMyInterface是否使用MyCustomAttribute属性进行修饰?
甚至比GetCustomAttributes更好的是Shared方法IsDefined:
Attribute.IsDefined(GetType(IMyInterface),GetType(MyCustomAttribute)) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |