LookupTableEventReceiver.OnCreating 方法
前的事件處理常式的CreateLookupTables和CreateLookupTablesMultiLang方法。
命名空間: Microsoft.Office.Project.Server.Events
組件: Microsoft.Office.Project.Server.Events.Receivers (在 Microsoft.Office.Project.Server.Events.Receivers.dll 中)
語法
'宣告
Public Overridable Sub OnCreating ( _
contextInfo As PSContextInfo, _
e As LookupTablePreEventArgs _
)
'用途
Dim instance As LookupTableEventReceiver
Dim contextInfo As PSContextInfo
Dim e As LookupTablePreEventArgs
instance.OnCreating(contextInfo, e)
public virtual void OnCreating(
PSContextInfo contextInfo,
LookupTablePreEventArgs e
)
參數
contextInfo
類型:Microsoft.Office.Project.Server.Library.PSContextInfo包含 Project Server 內容資訊。
備註
![]() |
---|
前與後事件的CreateLookupTables和CreateLookupTablesMultiLang方法公開LookupTableMultiLangDataSet,而不是LookupTableDataSet, e參數的事件處理常式中。 |
若要使用事件處理常式中的資料集,設定Microsoft.Office.Project.Schema.dll組件的參考。如需詳細資訊,請參閱 < How to: Create a Project Server Event Handler and Log an Event。
變更報表資料庫中的查閱表格資料的其他報表資料服務 (RDS) 事件的相關資訊,請參閱事件 RDB。
範例
下列程式碼片段是從不同資料表中LookupTableMultiLanguageDataSet取得資料的CreateLookupTables前的事件處理常式。
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"];
. . .
}