/// <summary> /// Enqueue the observed invocation in the observation queue of the machine /// </summary> /// <param name="e">event corresponding to the action</param> /// <param name="o">IObservationCallback ob</param> /// <param name="args">parameters of the action</param> public static void __OnEvent(EventInfo e, object o, object[] args) { IObservationCallback oc = o as IObservationCallback; if (oc == null || e == null) { throw new Exception("__OnEvent"); } Symbol actionSymbol = oc.GetActionSymbol(e); Term obs = ConstructInvocationTerm(actionSymbol, args); oc.Enqueue(obs); }
/// <summary> /// Remove the event and the associated delegate /// </summary> public static void Remove(EventInfo @event, IObservationCallback instance, System.Delegate delegateInstance) { getEventHandlerBuilder(@event).Remove(instance, delegateInstance); }
/// <summary> /// Create a delegate for the given event and instance /// that matches the delegate type of the event /// </summary> public static System.Delegate CreateAndAdd(EventInfo @event, IObservationCallback instance) { return(getEventHandlerBuilder(@event).CreateAndAdd(instance)); }