AsynchronousEventHandlerBasePreInit Method Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Initializes the value of the passed event handler properties to their corresponding properties.

Namespace: ContentStudio.EventActions.AsynchronousEventHandlers
Assembly: AsynchronousEventHandlers (in AsynchronousEventHandlers.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax

protected virtual void PreInit(
	int csEvent,
	int connectionId,
	int timeOut,
	ICSCredentialsContainer credentials
)

Parameters

csEvent
Type: SystemInt32
The event that triggered the job being executed. The value of these events are defined in the ContentStudioEvents enumeration
connectionId
Type: SystemInt32
A value that identifies the site.
timeOut
Type: SystemInt32
A timeout value (in seconds) to use. When zero is passed in, the implementation should use a default time out value ex. 30 seconds to avoid hung event handlers.
credentials
Type: ContentStudio.EventActionsICSCredentialsContainer
A reference to Content Studio's implementation of the ICSCredentialsContainer interface. This interface is used to pass system defined credentials to the custom implementation.
Remarks

When overridden in derived classes, a developer has the possibility to run some initialization code before the passed in XML has been parsed. Because this method actually sets these properties, any implementation must call the base class implementation in order to set the properties accordingly.
Examples

The following example shows how to interfere with the initialization process to check that the passed in timeout value is either zero or at least 10 seconds.

protected override void PreInit(int csEvent,
                                int connectionId,
                                int timeOut,
                                ICSCredentialsContainer credentials)
{
   if(timeOut < 0)
      timeOut = 0;
   else if(timeOut > 0 && timeOut < 10)
      timeOut = 10;
   //make sure to call the base class implementation!
   base.PreInit(csEvent, connectionId, timeOut, credentials);
}
See Also

Reference