I have a class Foo, which has a public event Bar. I need to clear all subscriptions to Bar.
In C# it is as easy as (within class Foo):
public void RemoveSubscribers() { this.Bar = null; }
(see also this question)
How do I do this in C++/CLI? I cannot set Bar to nullptr: the compiler spits out the error
Usage requires 'Foo::Bar' to be a data member
I've had a look at the RemoveAll method of Bar, but I don't understand what I should supply as arguments...
EDIT 1: For clarity, Bar was declared as follows:
public ref class Foo
{
public:
event MyEventHandler^ Bar;
};