/*****************************************************************************
* Copyright (c) 1990-98 Digi International Inc., All Rights Reserved
* 
* This software contains proprietary and confidential information of Digi
* International Inc.  By accepting transfer of this copy, Recipient agrees
* to retain this software in confidence, to prevent disclosure to others,
* and to make no use of this software other than that for which it was
* delivered.  This is an unpublished copyrighted work of Digi International
* Inc.  Except as permitted by federal law, 17 USC 117, copying is strictly
* prohibited.
* 
* Restricted Rights Legend
*
* Use, duplication, or disclosure by the Government is subject to
* restrictions set forth in sub-paragraph (c)(1)(ii) of The Rights in
* Technical Data and Computer Software clause at DFARS 252.227-7031 or
* subparagraphs (c)(1) and (2) of the Commercial Computer Software -
* Restricted Rights at 48 CFR 52.227-19, as applicable.
*
* Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
*
*****************************************************************************/


// ProtocolDisplayNameMap.cpp: implementation of the CProtocolDisplayNameMap class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "ProtocolDisplayNameMap.h"

#include "Resource.h"

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CProtocolDisplayNameMap::CProtocolDisplayNameMap()
{
   try
   {
      static const struct
      {
         TCHAR const * pszInternalName;
         UINT nDisplayNameID;
      }
      aProtocols[] =
      {
         { DXB_REGVAL_PROTOCOL_ENUM_NONE,          IDS_LineProtocol_None   },
         { DXB_REGVAL_PROTOCOL_ENUM_PRI,           IDS_LineProtocol_PRI    },
         { DXB_REGVAL_PROTOCOL_ENUM_T1,            IDS_LineProtocol_T1     },
         { DXB_REGVAL_PROTOCOL_ENUM_E1,            IDS_LineProtocol_E1     },
		 { DXB_REGVAL_PROTOCOL_ENUM_E1R2,          IDS_LineProtocol_E1R2   },
         { DXB_REGVAL_PROTOCOL_ENUM_BRI,           IDS_LineProtocol_BRI    },
         { DXB_REGVAL_PROTOCOL_ENUM_POTS,          IDS_LineProtocol_POTS   },
         { DXB_REGVAL_PROTOCOL_ENUM_FRAMERELAY,    IDS_LineProtocol_FR     },
         { DXB_REGVAL_PROTOCOL_ENUM_X25,           IDS_LineProtocol_X25    },
         { DXB_REGVAL_PROTOCOL_ENUM_SNA,           IDS_LineProtocol_SNA    },
         { DXB_REGVAL_PROTOCOL_ENUM_PPP,           IDS_LineProtocol_PPP    },
      };

      for (int i = 0; i < ElementCount(aProtocols); i++)
      {
         CString strDisplayName;
         AffirmThrow(strDisplayName.LoadString(aProtocols[i].nDisplayNameID));

         SetAt(aProtocols[i].pszInternalName, strDisplayName);
      }
   }
   catch (CAffirmException ae)
   {
   }
}

CProtocolDisplayNameMap::~CProtocolDisplayNameMap()
{
   RemoveAll();
}
