I once deployed a system wich used remoting, and where the server launched some events to which the client could subscribe to.
In order to make it possible, you have to set the typeFilterLevel to full, and, you also have to create an 'intermediate' object that is known on the client and on the server in order to be able to handle your events.
For instance:
This is the class that is known on the server & on the client side.
public abstract class MyDelegateObject : MarshalByRefObject
{
public void EventHandlerCallback( object sender, EventArgs e )
{
EventHandlerCallbackCore(sender, e);
}
protected abstract void EventHandlerCallbackCore(object sender, EventArgs e );
public override object InitializeLifetimeService() { return null; }
}
At the client-side, you create another class which inherits from the above class, and implements the actual logic that must be performed when the event is raised.
public class MyConcreteHandler : MyDelegateObject
{
protected override EventHandlerCallbackCore(object sender, EventArgs e)
{
// do some stuff
}
}
You simply attach the eventhandler to the event of the remote object like this:
MyConcreteHandler handler = new MyConcreteHandler();
myRemoteObject.MyEventOccured += new EventHandler(handler.EventHandlerCallback);
Offcourse, if you update Winform controls in your EventHandler class, that class should also implement ISynchronizeInvoke.