I have followed some tutorials on how to create custem event accessors. This is the code I have:
event ControlNameChangeHandler IProcessBlock.OnControlNameChanged
{
add
{
lock (ControlNameChanged)
{
ControlNameChanged += value;
}
}
remove
{
lock (ControlNameChanged)
{
ControlNameChanged -= value;
}
}
}
At the moment the code reaches lock(ControlNameChanged)
in the add statament, nothing happens. The code doesn't run any further. However my application is still working. It doesn't freeze or something.
What goes wrong?