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.

96 lines
1.7 KiB

  1. #ifdef _DEBUG
  2. #define new DEBUG_NEW
  3. #endif
  4. //////////////////////////////////////////////////////////////////////
  5. // Result Pane Item Members
  6. //////////////////////////////////////////////////////////////////////
  7. inline CHMEventResultsPaneItem* CRuleEvent::CreateResultsPaneItem(CResultsPaneView* pView)
  8. {
  9. if( ! pView )
  10. {
  11. ASSERT(FALSE);
  12. return NULL;
  13. }
  14. CHMEventResultsPaneItem* pItem = new CHMEventResultsPaneItem;
  15. pItem->SetDateTimeColumn(HMLV_LOWER_DTIME_INDEX);
  16. CStringArray saNames;
  17. CUIntArray uiaIconResIds;
  18. CString sValue;
  19. CEvent::GetStatus(m_iState,sValue);
  20. saNames.Add(sValue);
  21. sValue.Format(_T("%d"),m_iID);
  22. saNames.Add(sValue);
  23. saNames.Add(GetEventLocalTime());
  24. saNames.Add(m_sName);
  25. saNames.Add(m_sSystemName);
  26. saNames.Add(m_sMessage);
  27. switch( CEvent::GetStatus(m_iState) )
  28. {
  29. case HMS_CRITICAL:
  30. {
  31. uiaIconResIds.Add(IDI_ICON_CRITICAL);
  32. }
  33. break;
  34. case HMS_WARNING:
  35. {
  36. uiaIconResIds.Add(IDI_ICON_WARNING);
  37. }
  38. break;
  39. case HMS_NODATA:
  40. {
  41. uiaIconResIds.Add(IDI_ICON_NO_CONNECT);
  42. }
  43. break;
  44. case HMS_UNKNOWN:
  45. {
  46. uiaIconResIds.Add(IDI_ICON_UNKNOWN);
  47. }
  48. break;
  49. case HMS_SCHEDULEDOUT:
  50. {
  51. uiaIconResIds.Add(IDI_ICON_OUTAGE);
  52. }
  53. break;
  54. case HMS_DISABLED:
  55. {
  56. uiaIconResIds.Add(IDI_ICON_DISABLED);
  57. }
  58. break;
  59. case HMS_NORMAL:
  60. {
  61. uiaIconResIds.Add(IDI_ICON_NORMAL);
  62. }
  63. break;
  64. default:
  65. {
  66. ASSERT(FALSE);
  67. uiaIconResIds.Add(IDI_ICON_NORMAL);
  68. }
  69. }
  70. pItem->m_iState = CEvent::GetStatus(m_iState);
  71. pItem->m_st = m_st;
  72. pItem->m_sGuid = m_sStatusGuid;
  73. pItem->SetDisplayNames(saNames);
  74. pItem->SetIconIds(uiaIconResIds);
  75. pItem->SetIconIndex(0);
  76. pItem->SetToLowerPane();
  77. pItem->Create(pView);
  78. return pItem;
  79. }