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.

197 lines
3.8 KiB

  1. #ifndef PORTSPAGE_H
  2. #define PORTSPAGE_H
  3. #include "stdafx.h"
  4. #include "resource.h"
  5. #include "MNLBUIData.h"
  6. #include "CommonNLB.h"
  7. class PortsPage : public CPropertyPage
  8. {
  9. public:
  10. struct PortData
  11. {
  12. PortData();
  13. DWORD key;
  14. _bstr_t start_port;
  15. _bstr_t end_port;
  16. _bstr_t protocol;
  17. _bstr_t mode;
  18. _bstr_t priority;
  19. _bstr_t load;
  20. _bstr_t affinity;
  21. };
  22. enum
  23. {
  24. IDD = IDD_DIALOG_PORTS,
  25. };
  26. PortsPage( const _bstr_t& myMachineName,
  27. ClusterData* p_clusterData,
  28. UINT ID = PortsPage::IDD );
  29. PortsPage( ClusterData* p_clusterData,
  30. UINT ID = PortsPage::IDD );
  31. ~PortsPage();
  32. void
  33. getPresentPorts( vector<PortData>* ports );
  34. // overrides of CPropertyPage
  35. virtual void OnOK();
  36. virtual BOOL OnKillActive();
  37. virtual BOOL OnInitDialog();
  38. virtual void DoDataExchange( CDataExchange* pDX );
  39. afx_msg void OnButtonAdd();
  40. afx_msg void OnButtonDel();
  41. afx_msg void OnButtonModify();
  42. afx_msg void OnDoubleClick( NMHDR * pNotifyStruct, LRESULT * result );
  43. afx_msg void OnColumnClick( NMHDR * pNotifyStruct, LRESULT * result );
  44. afx_msg void OnSelchanged( NMHDR * pNotifyStruct, LRESULT * result );
  45. afx_msg BOOL OnHelpInfo (HELPINFO* helpInfo );
  46. afx_msg void OnContextMenu( CWnd* pWnd, CPoint point );
  47. // data members
  48. CListCtrl m_portList;
  49. CButton buttonAdd;
  50. CButton buttonModify;
  51. CButton buttonDel;
  52. ClusterData* m_clusterData;
  53. bool m_isClusterLevel;
  54. _bstr_t machine;
  55. private:
  56. bool m_sort_ascending;
  57. int m_sort_column;
  58. void
  59. SetControlData();
  60. DECLARE_MESSAGE_MAP()
  61. };
  62. static DWORD g_aHelpIDs_IDD_DIALOG_PORTS [] = {
  63. IDC_TEXT_PORT_RULE, IDC_LIST_PORT_RULE,
  64. IDC_LIST_PORT_RULE, IDC_LIST_PORT_RULE,
  65. IDC_BUTTON_ADD, IDC_BUTTON_ADD,
  66. IDC_BUTTON_MODIFY, IDC_BUTTON_MODIFY,
  67. IDC_BUTTON_DEL, IDC_BUTTON_DEL,
  68. IDC_GROUP_PORT_RULE_DESCR, IDC_GROUP_PORT_RULE_DESCR,
  69. IDC_TEXT_PORT_RULE_DESCR, IDC_GROUP_PORT_RULE_DESCR,
  70. 0, 0
  71. };
  72. class comp_start_port
  73. {
  74. public:
  75. bool operator()( PortsPage::PortData x, PortsPage::PortData y )
  76. {
  77. return ( _wtoi( x.start_port ) < _wtoi( y.start_port ) );
  78. }
  79. };
  80. class comp_end_port
  81. {
  82. public:
  83. bool operator()( PortsPage::PortData x, PortsPage::PortData y )
  84. {
  85. return ( _wtoi( x.end_port ) < _wtoi( y.end_port ) );
  86. }
  87. };
  88. class comp_protocol
  89. {
  90. public:
  91. bool operator()( PortsPage::PortData x, PortsPage::PortData y )
  92. {
  93. return ( x.protocol < y.protocol );
  94. }
  95. };
  96. class comp_mode
  97. {
  98. public:
  99. bool operator()( PortsPage::PortData x, PortsPage::PortData y )
  100. {
  101. return ( x.mode < y.mode );
  102. }
  103. };
  104. class comp_priority_string
  105. {
  106. public:
  107. bool operator()( PortsPage::PortData x, PortsPage::PortData y )
  108. {
  109. return ( x.priority < y.priority );
  110. }
  111. };
  112. class comp_priority_int
  113. {
  114. public:
  115. bool operator()( PortsPage::PortData x, PortsPage::PortData y )
  116. {
  117. return ( _wtoi( x.priority ) < _wtoi( y.priority ) );
  118. }
  119. };
  120. class comp_load_string
  121. {
  122. public:
  123. bool operator()( PortsPage::PortData x, PortsPage::PortData y )
  124. {
  125. return ( x.load < y.load );
  126. }
  127. };
  128. class comp_load_int
  129. {
  130. public:
  131. bool operator()( PortsPage::PortData x, PortsPage::PortData y )
  132. {
  133. return ( _wtoi( x.load ) < _wtoi( y.load ) );
  134. }
  135. };
  136. class comp_affinity
  137. {
  138. public:
  139. bool operator()( PortsPage::PortData x, PortsPage::PortData y )
  140. {
  141. return ( x.affinity < y.affinity );
  142. }
  143. };
  144. #endif