Generating application events

The ExtensionClassBase class provides a method, named FireApplicationEvent, that can be used to generate an application event.

protected bool FireApplicationEvent(string eventName, 
   bool sychronous, 
   bool transactional, 
   ref string result, 
   ref ApplicationEventParameter[] parameters) 
{ 
} 

Properties

Property Description
eventName The name of the event to generate
synchronous Determines if the event handlers should be executed synchronously (True) or asynchronously (False)
transactional Determines if the event handlers should be executed in a transaction

If passed as False and one of the synchronous handlers fails, any database activity performed by prior handlers remains committed.

result The value of the last RESULT( ) keyword executed on a Finish or Fail action on any handler
parameters An array of named parameters passed to the event handlers

Example

using Mongoose.IDO; 
using Mongoose.IDO.Protocol; 
using Mongoose.IDO.DataAccess; 
using Mongoose.Core.Common; 

[IDOExtensionClass("MyIDO")] 
public class TestFiringEvent : IDOExtensionClass 
{ 
   [IDOMethod(MethodFlags.None, "Infobar")] 
   public void FireMyEvent(string Parm1, long Parm2, ref string Infobar) 
   { 
      ApplicationEventParameter[] ParmList = new ApplicationEventParameter[2]; 
      string result = null; 
      ParmList[0] = new ApplicationEventParameter(); 
      ParmList[0].Name = "PString"; 
      ParmList[0].Value = Parm1; 
      ParmList[1] = new ApplicationEventParameter(); 
      ParmList[1].Name = "PNumeric"; 
      ParmList[1].Value = Parm2.ToString(); 
      if (!FireApplicationEvent("MyEvent", true, true, out result, ref ParmList))
      { 
         Infobar = result; 
      } 
   } 
}