#include "stdafx.h"

#include "xtr/dialog/ExportModel.h"

#include "resource.h"

namespace xtr::dialog {

#pragma warning( push )
#pragma warning( disable : 26440 26436 26454 )

BEGIN_MESSAGE_MAP(ExportModel, CDialog) // NOLINT(clang-diagnostic-unused-local-typedef)

END_MESSAGE_MAP()

#pragma warning( pop )

ExportModel::ExportModel(CWnd* pParent)
  : CDialog(IXTRD_EXPORT_MODEL, pParent) {}

void ExportModel::DoDataExchange(CDataExchange* pDX) {
  CDialog::DoDataExchange(pDX);

  ::DDX_Radio  (pDX, IXTRC_FILE_XLSX, typeRadio);

  if (pDX->m_bSaveAndValidate) {
    switch (typeRadio) {
    default: exportType = FileType::xlsx; break;
    case 1: exportType = FileType::json; break;
    }
  }
}

} // namespace xtr::dialog