using System; namespace MonoTests.SystemWeb.Framework { /// /// Base class for invokers, which can be used on its own when no user callbacks need /// to be executed in the Web context. When a user callback needs to be called, use /// one of the subclasses (the most common is /// ). /// /// [Serializable] public class BaseInvoker { bool _invokeDone = false; /// /// This method is called to activate the invoker. When /// is overriden, the subclasses should call the base class DoInvoke, if they want /// to use the default implementation. /// /// public virtual void DoInvoke (params object [] parameters) { _invokeDone = true; } /// /// This method returns the default URL specific to the invoker type. By default, /// there is no default URL. /// /// public virtual string GetDefaultUrl () { return null; } /// /// Checks whether DoInvoke was called or not. If subclasses do not override this /// method, they have to call to register the /// invocation. /// /// public virtual void CheckInvokeDone () { if (!_invokeDone) throw new Exception ("Invoker was not activated"); } } }