初始化 PlugInAttribute 類別的新執行個體。
命名空間: Microsoft.AnalysisServices.AdomdServer
組件: msmgdsrv (在 msmgdsrv.dll 中)
語法
'宣告
Public Sub New
'用途
Dim instance As New PlugInAttribute()
public PlugInAttribute()
public:
PlugInAttribute()
new : unit -> PlugInAttribute
public function PlugInAttribute()
備註
下列程式碼是 Analysis Services 個人化延伸模組 (ASPE) 的一部分,示範如何使用 PlugInAttribute 自訂屬性來標記程式碼。
注意
下列範例程式碼也可以從 Microsoft SQL Server Samples and Community Projects 網站下載。如需有關如何下載及安裝範例的詳細資訊,請參閱《SQL Server 線上叢書》中的<安裝 SQL Server 範例和範例資料庫>。
範例
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AnalysisServices.AdomdServer;
namespace ISV_1.ASClientExtensions
{
[PlugInAttribute]
public class ASClientExtensions
{
public ASClientExtensions()
{
Context.Server.SessionOpened += new EventHandler(this.SessionOpened);
Context.Server.SessionClosing += new EventHandler(this.SessionClosing);
//Verify and set environment for ClientExtensions.
AuthoringAndManagement environment = new AuthoringAndManagement();
}
~ASClientExtensions()
{
}
public void SessionOpened(object sender, EventArgs e)
{
// This will subscribe to the events.
SessionMgr session = new SessionMgr();
}
public void SessionClosing(object sender, EventArgs e)
{
}
}
}