#ifndef __MYSQL_VIEW_EDITOR_H__
#define __MYSQL_VIEW_EDITOR_H__

#include "mysql_view_editor.h"
#include "GrtTemplates.h"
#include "grtdb/db_object_helpers.h"

#ifdef _MSC_VER
//#include  <vcclr.h> // .net interop helpers
//using namespace MySQL::Grt;
using namespace System;
using namespace System::Collections::Generic;
using namespace System::Runtime::InteropServices;
#endif

namespace MySQL {
namespace Grt {
namespace Db {

public ref class MySQLViewEditorBE : public ViewEditorBE
{
protected:
  MySQLViewEditorBE(::MySQLViewEditorBE *inn)
    : ViewEditorBE(inn)
  {}

public:
  MySQLViewEditorBE::MySQLViewEditorBE(MySQL::Grt::GrtManager^ grtm, MySQL::Grt::GrtValue^ arglist)
  : ViewEditorBE(
      new ::MySQLViewEditorBE(grtm->get_unmanaged_object(), 
      db_mysql_ViewRef::cast_from(grt::BaseListRef::cast_from(arglist->get_unmanaged_object()).get(0)),
      get_rdbms_for_db_object(grt::BaseListRef::cast_from(arglist->get_unmanaged_object()).get(0))
        )
      )
  {
  }

  ::MySQLViewEditorBE *get_unmanaged_object()
  { return static_cast<::MySQLViewEditorBE *>(inner); }
};

} // namespace Db
} // namespace Grt
} // namespace MySQL

#endif // __MYSQL_VIEW_EDITOR_H__