AdomdConnection.CubeOpened 이벤트
큐브를 열 때 발생합니다.
네임스페이스: Microsoft.AnalysisServices.AdomdServer
어셈블리: msmgdsrv(msmgdsrv.dll)
구문
‘선언
Public Event CubeOpened As EventHandler
‘사용 방법
Dim instance As AdomdConnection
Dim handler As EventHandler
AddHandler instance.CubeOpened, handler
public event EventHandler CubeOpened
public:
event EventHandler^ CubeOpened {
void add (EventHandler^ value);
void remove (EventHandler^ value);
}
member CubeOpened : IEvent<EventHandler,
EventArgs>
Jscript는 이벤트 사용을 지원하지만 새로운 이벤트 선언은 지원하지 않습니다.
주의
다음 코드는 ASPE(Analysis Services Personalization Extensions)의 일부로서 CubeClosing 및 CubeOpened 이벤트를 사용하는 방법을 보여줍니다.
참고
다음 샘플 코드는 또한 Microsoft SQL Server Samples and Community Projects 웹 사이트에서 다운로드할 수 있습니다.
예
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AnalysisServices.AdomdServer;
namespace ISV_1.ASClientExtensions
{
public class SessionMgr
{
public SessionMgr()
{
Context.CurrentConnection.CubeOpened += new EventHandler(CubeOpened);
Context.CurrentConnection.CubeClosing += new EventHandler(CubeClosing);
}
~SessionMgr()
{
}
public void CubeOpened(object sender, EventArgs e)
{
String username = Context.CurrentConnection.User.Name;
username = username.Substring(username.IndexOf('\\')+1).ToLowerInvariant();
//Verify and set user experience for opened cube
// that is define calculated members according to user profile.
AuthoringAndManagement.DefineMembers(Context.CurrentDatabaseName, Context.CurrentCube.Name, username);
// that is define KPIs according to user profile
AuthoringAndManagement.DefineKPIs(Context.CurrentDatabaseName, Context.CurrentCube.Name, username);
// that is define sets according to user profile.
AuthoringAndManagement.DefineSets(Context.CurrentDatabaseName, Context.CurrentCube.Name, username);
}
public void CubeClosing(object sender, EventArgs e)
{
//Close and discard any object that requires clean-up
}
}
}