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.

167 lines
3.8 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1998 **/
  4. /**********************************************************************/
  5. /*
  6. nodes.h
  7. FILE HISTORY:
  8. */
  9. #include "stdafx.h"
  10. #include "nodes.h"
  11. // user editor
  12. #include "EditUser.h"
  13. /*---------------------------------------------------------------------------
  14. Class CTapiLine implementation
  15. ---------------------------------------------------------------------------*/
  16. /*!--------------------------------------------------------------------------
  17. Function
  18. Description
  19. Author: EricDav
  20. ---------------------------------------------------------------------------*/
  21. CTapiLineHandler::CTapiLineHandler
  22. (
  23. ITFSComponentData * pTFSCompData
  24. ) : CTapiHandler(pTFSCompData)
  25. {
  26. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  27. }
  28. /*!--------------------------------------------------------------------------
  29. CDhcpAllocationRange::InitializeNode
  30. Initializes node specific data
  31. Author: EricDav
  32. ---------------------------------------------------------------------------*/
  33. HRESULT
  34. CTapiLineHandler::InitializeNode
  35. (
  36. ITFSNode * pNode
  37. )
  38. {
  39. AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
  40. CString strTemp;
  41. SetDisplayName(strTemp);
  42. // Make the node immediately visible
  43. pNode->SetVisibilityState(TFS_VIS_SHOW);
  44. pNode->SetData(TFS_DATA_COOKIE, pNode);
  45. pNode->SetData(TFS_DATA_IMAGEINDEX, ICON_IDX_MACHINE);
  46. pNode->SetData(TFS_DATA_OPENIMAGEINDEX, ICON_IDX_MACHINE);
  47. pNode->SetData(TFS_DATA_USER, this);
  48. pNode->SetData(TFS_DATA_TYPE, TAPISNAP_LINE);
  49. return hrOK;
  50. }
  51. /*!--------------------------------------------------------------------------
  52. Function
  53. Description
  54. Author: EricDav
  55. ---------------------------------------------------------------------------*/
  56. STDMETHODIMP_(LPCTSTR)
  57. CTapiLineHandler::GetString
  58. (
  59. ITFSComponent * pComponent,
  60. MMC_COOKIE cookie,
  61. int nCol
  62. )
  63. {
  64. switch (nCol)
  65. {
  66. case 0:
  67. return GetDisplayName();
  68. case 1:
  69. return (LPCWSTR)m_strUsers;
  70. case 2:
  71. return (LPCWSTR)m_strStatus;
  72. }
  73. return NULL;
  74. }
  75. /*!--------------------------------------------------------------------------
  76. CTapiLineHandler::AddMenuItems
  77. Implementation of ITFSResultHandler::AddMenuItems
  78. Author: EricDav
  79. ---------------------------------------------------------------------------*/
  80. STDMETHODIMP
  81. CTapiLineHandler::AddMenuItems
  82. (
  83. ITFSComponent * pComponent,
  84. MMC_COOKIE cookie,
  85. LPDATAOBJECT pDataObject,
  86. LPCONTEXTMENUCALLBACK pContextMenuCallback,
  87. long * pInsertionAllowed
  88. )
  89. {
  90. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  91. HRESULT hr;
  92. CString strMenuItem;
  93. if (*pInsertionAllowed & CCM_INSERTIONALLOWED_TOP)
  94. {
  95. strMenuItem.LoadString(IDS_EDIT_USERS);
  96. hr = LoadAndAddMenuItem( pContextMenuCallback,
  97. strMenuItem,
  98. IDS_EDIT_USERS,
  99. CCM_INSERTIONPOINTID_PRIMARY_TOP,
  100. 0 );
  101. ASSERT( SUCCEEDED(hr) );
  102. }
  103. return hrOK;
  104. }
  105. /*!--------------------------------------------------------------------------
  106. CTapiLineHandler::Command
  107. Implementation of ITFSResultHandler::Command
  108. Author: EricDav
  109. ---------------------------------------------------------------------------*/
  110. STDMETHODIMP
  111. CTapiLineHandler::Command
  112. (
  113. ITFSComponent * pComponent,
  114. MMC_COOKIE cookie,
  115. int nCommandID,
  116. LPDATAOBJECT pDataObject
  117. )
  118. {
  119. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  120. switch (nCommandID)
  121. {
  122. case IDS_EDIT_USERS:
  123. OnEditUsers(pComponent, cookie);
  124. break;
  125. default:
  126. break;
  127. }
  128. return hrOK;
  129. }
  130. HRESULT
  131. CTapiLineHandler::OnEditUsers(ITFSComponent * pComponent, MMC_COOKIE cookie)
  132. {
  133. /*
  134. CEditUsers dlgEditUsers;
  135. if (dlgEditUsers.DoModal() == IDOK)
  136. {
  137. }
  138. */
  139. return hrOK;
  140. }