Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
1.9 KiB

  1. // SnapMgr.cpp : implementation file for Snapin Manager property page
  2. //
  3. #include "stdafx.h"
  4. #include "SnapMgr.h"
  5. #include "compdata.h" // CFileMgmtComponentData
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // This array is used to map a radio button to an object type
  13. static const FileMgmtObjectType rgRadioToObjectType[] =
  14. {
  15. FILEMGMT_ROOT,
  16. FILEMGMT_SHARES,
  17. FILEMGMT_SESSIONS,
  18. FILEMGMT_RESOURCES,
  19. FILEMGMT_SERVICES,
  20. };
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CFileMgmtGeneral property page
  23. // IMPLEMENT_DYNCREATE(CFileMgmtGeneral, CChooseMachinePropPage)
  24. BEGIN_MESSAGE_MAP(CFileMgmtGeneral, CChooseMachinePropPage)
  25. //{{AFX_MSG_MAP(CFileMgmtGeneral)
  26. //}}AFX_MSG_MAP
  27. END_MESSAGE_MAP()
  28. CFileMgmtGeneral::CFileMgmtGeneral() : CChooseMachinePropPage(IDD_FILE_FILEMANAGEMENT_GENERAL)
  29. {
  30. m_pFileMgmtData = NULL;
  31. //{{AFX_DATA_INIT(CFileMgmtGeneral)
  32. m_iRadioObjectType = 0;
  33. //}}AFX_DATA_INIT
  34. }
  35. CFileMgmtGeneral::~CFileMgmtGeneral()
  36. {
  37. }
  38. void CFileMgmtGeneral::SetFileMgmtComponentData(CFileMgmtComponentData * pFileMgmtData)
  39. {
  40. ASSERT(pFileMgmtData != NULL);
  41. m_pFileMgmtData = pFileMgmtData;
  42. m_iRadioObjectType = pFileMgmtData->QueryRootCookie().QueryObjectType() - FILEMGMT_ROOT; // CODEWORK dangerous
  43. }
  44. void CFileMgmtGeneral::DoDataExchange(CDataExchange* pDX)
  45. {
  46. CChooseMachinePropPage::DoDataExchange(pDX);
  47. DDX_Radio(pDX, IDC_RADIO_ALL, m_iRadioObjectType);
  48. //{{AFX_DATA_MAP(CFileMgmtGeneral)
  49. //}}AFX_DATA_MAP
  50. }
  51. BOOL CFileMgmtGeneral::OnWizardFinish()
  52. {
  53. BOOL f = CChooseMachinePropPage::OnWizardFinish();
  54. ASSERT(m_pFileMgmtData != NULL);
  55. ASSERT(m_iRadioObjectType >= 0 && m_iRadioObjectType < LENGTH(rgRadioToObjectType));
  56. m_pFileMgmtData->QueryRootCookie().SetObjectType( rgRadioToObjectType[m_iRadioObjectType] );
  57. return f;
  58. }
  59. #include "chooser.cpp"