Server.SessionClosing イベント

実行中の Analysis Services のインスタンスのあるサーバーと、クライアントとの間のセッションが閉じられようとしてから、セッションが完全に閉じられるまでに発生します。

名前空間:  Microsoft.AnalysisServices.AdomdServer
アセンブリ:  msmgdsrv (msmgdsrv.dll)

構文

'宣言
Public Event SessionClosing As EventHandler
'使用
Dim instance As Server 
Dim handler As EventHandler 

AddHandler instance.SessionClosing, handler
public event EventHandler SessionClosing
public:
 event EventHandler^ SessionClosing {
    void add (EventHandler^ value);
    void remove (EventHandler^ value);
}
member SessionClosing : IEvent<EventHandler,
    EventArgs>
JScript はイベントの使用をサポートしていますが、新規の宣言はサポートしていません。

説明

次のコードは、ASPE (Analysis Services のパーソナル化拡張機能) の一部であり、SessionClosing イベントと SessionOpened イベントの使用方法を示しています。

注意

次のサンプル コードは、Microsoft SQL Server Samples and Community Projects Web サイトからもダウンロードできます。 サンプルのダウンロード方法およびインストール方法の詳細については、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)

{

}

}

}

関連項目

参照

Server クラス

Microsoft.AnalysisServices.AdomdServer 名前空間