Hi. Given the following classes, how can i intercept Class1.SampleMethod's Value from SampleAttribute? Thanks
Public Class Class1
<SampleAttribute()> _
Public Function SampleMethod(ByVal Value As Integer) As Boolean
Return True
End Function
End Class
<AttributeUsage(AttributeTargets.Method)> _
Public Class SampleAttribute
Inherits System.Attribute
Private _Value As Integer
Property Value() As Integer
Get
Return _Value
End Get
Set(ByVal value As Integer)
_Value = value
End Set
End Property
Public Sub New()
End Sub
End Class
EDIT:
Given Andrew Hare's answer, maybe I'm trying to use the wrong construct. I have a long list of similar methods and i need to execute a set of operations every time one of them is called. I thought that attaching an attribute to each of them would be the most straight-forward solution. Any suggestion?