LookupTableEventReceiver.OnCreated 方法
後續的事件處理常式的CreateLookupTables和CreateLookupTablesMultiLang方法。
命名空間: Microsoft.Office.Project.Server.Events
組件: Microsoft.Office.Project.Server.Events.Receivers (在 Microsoft.Office.Project.Server.Events.Receivers.dll 中)
語法
'宣告
Public Overridable Sub OnCreated ( _
contextInfo As PSContextInfo, _
e As LookupTablePostEventArgs _
)
'用途
Dim instance As LookupTableEventReceiver
Dim contextInfo As PSContextInfo
Dim e As LookupTablePostEventArgs
instance.OnCreated(contextInfo, e)
public virtual void OnCreated(
PSContextInfo contextInfo,
LookupTablePostEventArgs 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。
範例
下列程式碼示範如何取得資料,例如LookupTableLanguages、 LookupTables,以及LookupTableValues不同資料表中的範例。
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"];
. . .
}
若要使用事件處理常式中的資料集,設定Microsoft.Office.Project.Schema.dll組件的參考。如需詳細資訊,請參閱 < How to: Create a Project Server Event Handler and Log an Event。