Server.SessionOpened 이벤트
실행 중인 Analysis Services 인스턴스가 있는 서버가 클라이언트와의 세션을 시작할 때 발생합니다.
네임스페이스: Microsoft.AnalysisServices.AdomdServer
어셈블리: msmgdsrv(msmgdsrv.dll)
구문
‘선언
Public Event SessionOpened As EventHandler
‘사용 방법
Dim instance As Server
Dim handler As EventHandler
AddHandler instance.SessionOpened, handler
public event EventHandler SessionOpened
public:
event EventHandler^ SessionOpened {
void add (EventHandler^ value);
void remove (EventHandler^ value);
}
member SessionOpened : IEvent<EventHandler,
EventArgs>
Jscript는 이벤트 사용을 지원하지만 새로운 이벤트 선언은 지원하지 않습니다.
주의
다음 코드는 ASPE(Analysis Services Personalization Extensions)의 일부로서 SessionClosing 및 SessionOpened 이벤트를 사용하는 방법을 보여줍니다.
참고
다음 샘플 코드는 또한 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)
{
}
}
}