LookupTableEventReceiver.OnCreating Method
A pre-event handler for the CreateLookupTables and CreateLookupTablesMultiLang methods.
Namespace: Microsoft.Office.Project.Server.Events
Assembly: Microsoft.Office.Project.Server.Events.Receivers (in Microsoft.Office.Project.Server.Events.Receivers.dll)
Syntax
'Declaration
Public Overridable Sub OnCreating ( _
contextInfo As PSContextInfo, _
e As LookupTablePreEventArgs _
)
'Usage
Dim instance As LookupTableEventReceiver
Dim contextInfo As PSContextInfo
Dim e As LookupTablePreEventArgs
instance.OnCreating(contextInfo, e)
public virtual void OnCreating(
PSContextInfo contextInfo,
LookupTablePreEventArgs e
)
Parameters
- contextInfo
Type: Microsoft.Office.Project.Server.Library.PSContextInfo
Contains the Project Server context information.
- e
Type: Microsoft.Office.Project.Server.Events.LookupTablePreEventArgs
The data for the event.
Remarks
Note
The pre- and post-events for both the CreateLookupTables and CreateLookupTablesMultiLang methods expose LookupTableMultiLangDataSet, rather than a LookupTableDataSet, in the e parameter of event handlers.
To use datasets in event handlers, set a reference to the Microsoft.Office.Project.Schema.dll assembly. For more information, see How to: Create a Project Server Event Handler and Log an Event.
For information about additional Report Data Service (RDS) events for changing lookup table data in the Reporting database, see Events for the RDB.
Examples
The following code fragment is a pre-event handler for CreateLookupTables that gets data from different tables in a LookupTableMultiLanguageDataSet.
using PSLibrary = Microsoft.Office.Project.Server.Library;
. . .
public class LookupTableEvents : LookupTableEventReceiver
{
public override void OnCreating(PSLibrary.PSContextInfo contextInfo,
LookupTablePreEventArgs e)
{
int lutLanguage =
(int)e.LookupTableInformation.LookupTableLanguages.Rows[0]["LCID"];
Guid lutMultiUid =
(Guid)e.LookupTableInformation.LookupTables.Rows[0]["LT_UID"];
string lutMultiValue =
(string)e.LookupTableInformation.LookupTableValues.Rows[0]["LT_VALUE_TEXT"];
. . .
}
See Also
Reference
LookupTableEventReceiver Class