예제 #1
0
bool MvcBook::OpenModel(MvcModel* pModel)
{
	if(!pModel)
	{
		System::LogMessage("MvcBook::OpenModel: pModel is NULL");
		return false;
	}

	if(!m_pBook)
	{
		System::LogMessage("MvcBook::OpenModel: m_pBook is NULL");
		return false;
	}

	AutoPtrT<MvcView> pView;

	pView.reset(pModel->CreateView());
	if(!pView)
	{
		System::LogMessage("MvcBook::OpenModel: pModel->CreateView return NULL");
		return false;
	}

	if(!pView->OnCreated())
	{
		System::LogMessage("MvcBook::OpenModel: pView->Create return false");
		return false;
	}

	if(!AttachView(pView.get())) return false;

	pView.release();
	return true;

}
예제 #2
0
파일: mvc_book.cpp 프로젝트: hanwd/ew_base
bool MvcBook::OpenModel(MvcModel* pModel)
{
	
	if(!pModel)
	{
		System::LogMessage("MvcBook::OpenModel: pModel is NULL");
		return false;
	}

	if(!m_pBook)
	{
		System::LogMessage("MvcBook::OpenModel: m_pBook is NULL");
		return false;
	}

	
	LockGuard<WndUpdator> lock(WndManager::current().wup);

	AutoPtrT<MvcView> pView;

	pView.reset(pModel->CreateView());
	if(!pView)
	{
		System::LogMessage("MvcBook::OpenModel: pModel->CreateView return NULL");
		return false;
	}

	if(!pView->OnCreated())
	{
		System::LogMessage("MvcBook::OpenModel: pView->Create return false");
		return false;
	}

	if(!AttachView(pView.get())) return false;

	pView.release();
	return true;

}