Imports System.Reflection
Public Class PluginFunction
'''
''' Gets the method to invoke when invoking this PluginFunction.
'''
'''
Public ReadOnly Property Method As MethodInfo
'''
''' Gets the refered Plugin for this PluginFunction, if it has one.
'''
'''
Public ReadOnly Property Plugin As Plugin
'''
''' Gets the Parameters that was given by the attribute.
'''
'''
Public ReadOnly Property Params As Object()
'''
''' Gets the function code for this PluginFunction.
'''
'''
Public ReadOnly Property FunctionCode As String
'''
''' Creates a new instance of a PluginFunction.
'''
''' The Method to invoke when invoking this PluginFunction.
''' The Plugin that is the Parent of this PluginFunction. This value can be NULL.
Public Sub New(method As MethodInfo, plugin As Plugin)
Me.Method = method
Me.Plugin = plugin
End Sub
'''
''' Creates a new instance of a PluginFunction.
'''
''' The Method to invoke when invoking this PluginFunction..
''' The Plugin that is the Parent of this PluginFunction. This value can be NULL.
''' The Parameters that was given by the attribute.
''' The function code for this PluginFunction.
Public Sub New(method As MethodInfo, plugin As Plugin, params As Object(), funcCode As String)
Me.New(method, plugin)
Me.Params = params
Me.FunctionCode = funcCode
End Sub
'''
''' Invokes the Method of the PluginFunction.
'''
Public Sub Invoke()
Method.Invoke(Nothing, Nothing)
End Sub
'''
''' Invokes the Method of the PluginFunction.
'''
Public Sub Invoke(ParamArray params As Object())
Method.Invoke(Nothing, params)
End Sub
'''
''' Invokes the Method of the PluginFunction and returns the return value.
'''
Public Function InvokeGet(ParamArray params As Object()) As Object
Return Method.Invoke(Nothing, params)
End Function
End Class