Server.SessionOpened 事件

Occurs when the server that has the running instance of Analysis Services starts a session with the client.

命名空间:  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 支持使用事件,但不支持声明新事件。

注释

The following code is part of the Analysis Services Personalization Extensions (ASPE) and shows how to use SessionClosing and SessionOpened events.

注意注意

The following sample code can also be downloaded from the Microsoft SQL Server Samples and Community Projects Web site. For more information about how to download and install samples, see Installing SQL Server Samples and Sample Databases in SQL Server Books Online.

示例

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 命名空间