M
Marc Selis
Hi,
I have a class with a static constructor in which the class registers itself
as capable of doing something (using a delegate)
The problem is that the static constructor is never called, as no other
class references it. The only way to communicate with the class is using
the delegate.
Here is my code:
internal class Factory
{
static Factory()
{
Configurator.RequestNew+=new RequestNewDelegate(OnRequestNew);
}
private static void OnRequestNew(string _objectName, ref ConfigObject
_object)
{
//Handle request
}
}
Is there any way to force the static constructor to be executed, using
attributes or something?
Regards,
Marc Selis
I have a class with a static constructor in which the class registers itself
as capable of doing something (using a delegate)
The problem is that the static constructor is never called, as no other
class references it. The only way to communicate with the class is using
the delegate.
Here is my code:
internal class Factory
{
static Factory()
{
Configurator.RequestNew+=new RequestNewDelegate(OnRequestNew);
}
private static void OnRequestNew(string _objectName, ref ConfigObject
_object)
{
//Handle request
}
}
Is there any way to force the static constructor to be executed, using
attributes or something?
Regards,
Marc Selis