Can closing file be canceled?

I tried to prevent user closing dgn file if a certain task hasn't been finished using C#.

Is there an event handler on file closing and some parameter can be set so that the closing action can be canceled?

Gang

Parents
  • In C (aka MDL):

    Private int     queueMonitor
    (
    Inputq_element     *qeP  /* <=> pointer to queue element */
    )
        {
        if ( qeP->hdr.cmdtype == CMDNUM )   
            {
            switch ( qeP->u.cmd.command )
                {
                 case CMD_EXIT:
                 case CMD_NEWFILE:
                 case CMD_CREATE_DRAWING:
                 case CMD_DIALOG_OPENFILE:
                 case CMD_EXCHANGEFILE:
                 case CMD_CLOSE_DESIGN:    

                 if ( cancelDrawingClose )
                    return INPUT_REJECT;

                 break;
                }
            }

        return INPUT_ACCEPT;
        }





    // establish hook
            mdlInput_setMonitorFunction ( MONITOR_ALL,       queueMonitor );

    Cheers,

    /Chris Z.

  • Chris,

    Thanks for your coding using MDL. Can that be implemented in C#? Since our current Add-in is written in C#.

    Gang

Reply Children