// EdIRBVwR.cpp : implementation file
//

#include "stdafx.h"

#include "Defines.hpp"

#ifdef D_ED_IR_ACTIVE

#include "EdIRBVwR.hpp"

#include "EdIRBVw.hpp"
#include "EdIRBeEn.hpp"
#include "EdIRBELs.hpp"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// class CPA_EdIR_UndoRenameBehaviour
/////////////////////////////////////////////////////////////////////////////

/**********************************************************************************/
CPA_EdIR_UndoRenameBehaviour::CPA_EdIR_UndoRenameBehaviour(CPA_EdIR_DiagView *pclDiagView,
														   CPA_EdIR_MainBehaviour *pclMainBehaviour,
														   CPA_EdIR_MainBehaviourList *pclMainBehaviourList,
														   CString csOldName,
														   CString csNewName,
														   BOOL bBlock)
	:CPA_Modif(1,"Rename Behaviour",bBlock)
{
	m_pclDiagView=pclDiagView;
	m_pclMainBehaviour=pclMainBehaviour;
	m_pclMainBehaviourList=pclMainBehaviourList;
	m_csOldName=csOldName;
	m_csNewName=csNewName;
}

/**********************************************************************************/
CPA_EdIR_UndoRenameBehaviour::~CPA_EdIR_UndoRenameBehaviour()
{
}

/**********************************************************************************/
BOOL CPA_EdIR_UndoRenameBehaviour::Do()
{
	m_pclMainBehaviourList->m_fn_vSetModified(TRUE);

	return m_pclDiagView->m_fn_bRenameBehaviour(m_pclMainBehaviour,m_csNewName);
}

/**********************************************************************************/
BOOL CPA_EdIR_UndoRenameBehaviour::Undo()
{
	m_pclMainBehaviourList->m_fn_vSetModified(TRUE);

	return m_pclDiagView->m_fn_bRenameBehaviour(m_pclMainBehaviour,m_csOldName);
}

#endif //D_ED_IR_ACTIVE
