#include "StdAfx.h"
|
#include "MBTransExtendEvents.h"
|
|
|
|
EventTransReqList::EventTransReqList(SObject *pSender)
|
:TplEventArgs<EventTransReqList>(pSender)
|
{
|
RemoveAllDownloadFileInfo();
|
}
|
|
EventTransReqList::~EventTransReqList()
|
{
|
RemoveAllDownloadFileInfo();
|
}
|
|
bool EventTransReqList::AddDownloadFileInfo(CMBDownFileInfo *pDownFileInfo)
|
{
|
if( NULL == pDownFileInfo || pDownFileInfo->m_strID.IsEmpty() )
|
return false;
|
|
CMBDownloadFileInfoMap::iterator it;
|
CString strID;
|
|
strID = pDownFileInfo->m_strID;
|
it = m_mapDownloadFileInfo.find(strID);
|
|
// Èç¹ûÕҵõ½ ·µ»Ø
|
if( it != m_mapDownloadFileInfo.end() )
|
return false;
|
|
m_mapDownloadFileInfo[strID] = pDownFileInfo;
|
m_vectorDownloadFileInfo.push_back(pDownFileInfo);
|
|
return true;
|
}
|
|
int EventTransReqList::GetCount()
|
{
|
return m_mapDownloadFileInfo.size();
|
}
|
|
CString EventTransReqList::GetIDS()
|
{
|
int nCount = m_mapDownloadFileInfo.size();
|
if( 0 == nCount )
|
return _T("");
|
|
CString strIDS;
|
CMBDownloadFileInfoMap::iterator it;
|
CMBDownFileInfo *pDownFileInfo = NULL;
|
for( it = m_mapDownloadFileInfo.begin();it != m_mapDownloadFileInfo.end();it++ )
|
{
|
pDownFileInfo = it->second;
|
strIDS += pDownFileInfo->m_strID;
|
strIDS += _T(";");
|
}
|
|
return strIDS.Left(strIDS.GetLength()-1);
|
}
|
|
|
bool EventTransReqList::RemoveAllDownloadFileInfo()
|
{
|
CMBDownloadFileInfoMap::iterator it;
|
CMBDownFileInfo *pDownFileInfo = NULL;
|
|
for( it = m_mapDownloadFileInfo.begin();it != m_mapDownloadFileInfo.end();it++ )
|
{
|
pDownFileInfo = it->second;
|
delete pDownFileInfo;
|
pDownFileInfo = NULL;
|
}
|
m_mapDownloadFileInfo.clear();
|
m_vectorDownloadFileInfo.clear();
|
|
return true;
|
}
|