Evento Server.SessionOpened
Se produce cuando el servidor con la instancia en ejecución de Analysis Services inicia una sesión con el cliente.
Espacio de nombres: Microsoft.AnalysisServices.AdomdServer
Ensamblado: msmgdsrv (en msmgdsrv.dll)
Sintaxis
'Declaración
Public Event SessionOpened As EventHandler
'Uso
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 admite el uso de eventos, pero no la declaración de otros nuevos.
Comentarios
El código siguiente forma parte de las Extensiones de personalización de Analysis Services (ASPE) y muestra cómo usar los eventos SessionClosing y SessionOpened.
Nota
El código de ejemplo siguiente también se puede descargar desde el sitio web Microsoft SQL Server Samples and Community Projects.Para obtener más información acerca de cómo descargar e instalar ejemplos, vea Instalar ejemplos y bases de datos de ejemplo de SQL Server en los Libros en pantalla de SQL Server.
Ejemplos
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)
{
}
}
}