Visio.SelectionChangedEventArgs interface

Proporciona información sobre la colección de formas que ha generado el evento SelectionChanged.

Comentarios

Conjunto de API: 1.1

Usada por

Ejemplos

let eventResult; // Global variable to store the EventHandlerResult returned on attaching handler.

function AttachHandler() {
    Visio.run(session, function(ctx) {
        const doc = ctx.document;
        eventResult = doc.onSelectionChanged.add(
            function (args) {
                console.log("Selected Shape Name: "+args.shapeNames[0]);
            });
        return ctx.sync().then(function(){
            console.log("Handler attached");
        });
    }).catch(function(error) {
        console.log("Error: " + error);
        if (error instanceof OfficeExtension.Error) {
            console.log("Debug info: " + JSON.stringify(error.debugInfo));
        }
    });

    function onSelectionChanged(args) {
        console.log(Date.now() + "Selection Changes Event" + JSON.stringify(args));
    }
}

function RemoveHandler() {
    if (!eventResult || !eventResult.context) {
        console.log("Handler has not been attached");
        return;
    }

    Visio.run(eventResult.context, function(ctx) {
        eventResult.remove();
        return ctx.sync().then(function (){
            eventResult = null;
            console.log("Handler removed");
        });
    }).catch(function(error) {
        console.log("Error: " + error);
        if (error instanceof OfficeExtension.Error) {
            console.log("Debug info: " + JSON.stringify(error.debugInfo));
        }
    });
}

Propiedades

pageName

Obtiene el nombre de la página que tiene el objeto de colección ShapeCollection que ha generado el evento SelectionChanged.

shapeNames

Obtiene la matriz de nombres de forma que ha generado el evento SelectionChanged.

Detalles de las propiedades

pageName

Obtiene el nombre de la página que tiene el objeto de colección ShapeCollection que ha generado el evento SelectionChanged.

pageName: string;

Valor de propiedad

string

Comentarios

Conjunto de API: 1.1

shapeNames

Obtiene la matriz de nombres de forma que ha generado el evento SelectionChanged.

shapeNames: string[];

Valor de propiedad

string[]

Comentarios

Conjunto de API: 1.1