Quintiq file version 2.0
#parent: #root
Method RegisterForms (
  internal[WebForm] form,
  Boolean isopen
) id:Method_ApplicationMacroPlanner_RegisterForms
{
  #keys: '[138546.0.75241093]'
  Body:
  [*
    // Add or remove form from our form struct
    if( not isnull( MacroPlan ) )
    { 
      // Flush dataholder before adding in new form, assumption there is always 1 opened form only
      DataHolderOpenedForms.Data().Flush();  
      if( isopen ) // Prevent added the same form twice
      {
        DataHolderOpenedForms.Data().Add( form );
        DataHolderOpenedForms.Data( DataHolderOpenedForms.Data().Unique() );  // To prevent the form from getting registered twice
        // Refresh forms data
        this.RefreshFormsData();
      }
      /*else
      {
        DataHolderOpenedForms.Data().Remove( form );
      }*/
    }
  *]
}
