onOpen Static

onOpen: BeEvent<(_requestContext: AuthorizedClientRequestContext | ClientRequestContext, _briefcaseProps: BriefcaseProps) => void> = new BeEvent<(_requestContext: AuthorizedClientRequestContext | ClientRequestContext, _briefcaseProps: BriefcaseProps) => void>()

Event raised just before a BriefcaseDb is opened.

  • If the open requires authorization AuthorizedClientRequestContext is passed in to the event handler. Otherwise ClientRequestContext is passed in Example:
    BriefcaseDb.onOpen.addListener((_requestContext: AuthorizedClientRequestContext | ClientRequestContext, briefcaseProps: BriefcaseProps) => {
     // A read-only service might want to reject all requests to open an iModel for writing. It can do this in the onOpen event.
     if (briefcaseProps.openMode !== OpenMode.Readonly)
       throw new IModelError(IModelStatus.BadRequest, "Navigator is readonly");
    });

Defined in

Last Updated: 13 May, 2020