Preparing search index...

    Stores event listener connections, automatically cleaned up on scope exit.

        // ScopedConnection is the handle returned by signal.connect(). Store it
    // for the lifetime you want the handler to stay active — disconnect() in
    // stop() to cleanly detach when the plugin unloads.
    const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;

    // onProjectChanged fires when switching projects; onProjectSaving fires
    // after a save completes (use it to react to Save As landing on disk).
    const changedConn: Editor.ScopedConnection = model.onProjectChanged.connect(() => {
    console.log('switched to a new project');
    });
    const savingConn: Editor.ScopedConnection = model.onProjectSaving.connect(
    (mode: Editor.Model.ProjectSaveMode) => {
    console.log(`project saved, mode=${mode}`);
    }
    );

    // Retain both connections so they are not garbage-collected while alive.
    this.connections.push(changedConn, savingConn);
    console.log(`Active connections: ${this.connections.filter(c => c.isConnected).length}`);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    isConnected: boolean

    Indicates whether the connection is currently active.

    Methods

    • Disconnects the associated signal connection and returns true if it was active.

      Returns boolean

    • Free the guarded resource immediately.

      Returns void

    • Returns the name of this object's type.

      Returns string

    • Returns true if the object is of the specified type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object refers to the same instance as the given object.

      Parameters

      Returns boolean