Is there a way to shorten the following:
public class Test
{
/* declares a delegate type (named MyDelegateType) which has a single parameter of
type float and doesn't return anything. */
public delegate void MyDelegateType(float f);
/* defines a reference to an object of type MyDelegateType */
private MyDelegateType MyDelegateRef;
... // say we have a Property to set and get MyDelegateRef, and a method
// for executing its target
}
into one line, without using Action/Func types?
I'm asking this to understand if there's an equivalent to what we can do in C++ (or C) with a function pointer:
class Test
{
/* defines a pointer (named MyFP) to a function with a single
parameter of type float, and doesn't return anything */
void(*MyFP)(float);
... // say we have a Setter & Getter functions, and an Execute
// function for executing MyFP
}