Pre Closing event

PropertyManagerPageHandlerEx::Closing event is raised when property manager page is about to be closed.

Framework passes the reason of close and closing argument which allows to cancel property manager page closing and display error to the user as a tooltip.

m_Page.Handler.Closing += (r, a) =>
{
    if (r == swPropertyManagerPageCloseReasons_e.swPropertyManagerPageClose_Okay)
    {
        if (string.IsNullOrEmpty(m_Data.Text))
        {
            a.Cancel = true;
            a.ErrorTitle = "Insert Note Error";
            a.ErrorMessage = "Please specify the note text";
        }
    }
};

This event is raised when Property Manager Page dialog is still visible. There should be no rebuild operations performed within this handler, it includes the direct rebuilds but also any new features or geometry creation or modification (with an exception of temp bodies). Note that some operations such as saving may also be unsupported. In general if certain operation cannot be performed from the user interface while property page is opened it shouldn’t be called from the closing event via API as well. Otherwise this could cause instability including crashes. Use Post closing event event to perform any rebuild operations.

In some cases it is required to perform this operation while property manager page stays open. Usually this happens when page supports pining (swPropertyManagerOptions_PushpinButton flag of swPropertyManagerPageOptions_e enumeration in PageOptionsAttribute). In this case it is required to set the swPropertyManagerOptions_LockedPage flag of swPropertyManagerPageOptions_e enumeration in PageOptionsAttribute. This would enable the support of rebuild operations and feature creation from within the PropertyManagerPageHandlerEx::Closing event.

Post closing event

PropertyManagerPageHandlerEx::Closed event is raised when property manager page is closed.

Use this handler to perform the required operations.

m_Page.Handler.Closed += r =>
{
    if (r == swPropertyManagerPageCloseReasons_e.swPropertyManagerPageClose_Okay)
    {
        //Do work
    }
};