Leaked source code of windows server 2003
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.

133 lines
3.7 KiB

  1. Attribute VB_Name = "Module1"
  2. Option Explicit
  3. Sub ListTheClusters(oClusterApp As MSClusterLib.Application, ClusTree As TreeView)
  4. Dim oClusters As Clusters
  5. Set oClusters = oClusterApp.Clusters
  6. Dim nCount As Integer
  7. nCount = oClusters.Count
  8. Dim i As Integer
  9. Dim ChildNode As Node
  10. ClusTree.Nodes.Add , , "Clusters", "Clusters"
  11. For i = 1 To nCount
  12. Set ChildNode = ClusTree.Nodes.Add("Clusters", tvwChild, oClusters(i), oClusters(i))
  13. ChildNode.Tag = "Cluster"
  14. Next i
  15. End Sub
  16. Sub ListTheNodes(oCluster As Cluster, ClusTree As TreeView)
  17. Dim s As String
  18. Dim oNodes As ClusNodes
  19. Set oNodes = oCluster.Nodes
  20. Dim nCount As Integer
  21. nCount = oNodes.Count
  22. Debug.Print nCount & " nodes"
  23. Dim oNode As ClusNode
  24. Dim i As Integer
  25. Dim ChildNode As Node
  26. Dim RootNode As Node
  27. Set RootNode = ClusTree.Nodes.Add(, , "Nodes", oCluster.Name)
  28. For i = 1 To nCount
  29. Set oNode = oNodes(i)
  30. s = oNode.Name & "(" & oNode.NodeID & ")"
  31. Set ChildNode = ClusTree.Nodes.Add("Nodes", tvwChild, oNode.Name, s)
  32. ChildNode.Tag = "Node"
  33. ListTheResourceGroups oNode, ClusTree, oNode.Name
  34. Set oNode = Nothing
  35. Next
  36. End Sub
  37. Sub ListTheResourceGroups(oNode As ClusNode, ClusTree As TreeView, Key As String)
  38. Dim oResourceGroups As ClusResGroups
  39. Set oResourceGroups = oNode.ResourceGroups
  40. Dim nCount As Integer
  41. nCount = oResourceGroups.Count
  42. Debug.Print nCount & " resource groups"
  43. Dim oResourceGroup As ClusResGroup
  44. Dim i As Integer
  45. Dim ChildNode As Node
  46. For i = 1 To nCount
  47. Set oResourceGroup = oResourceGroups(i)
  48. Set ChildNode = ClusTree.Nodes.Add(Key, tvwChild, oResourceGroup.Name, oResourceGroup.Name)
  49. ChildNode.Tag = "Group"
  50. ListTheResources oResourceGroup, ClusTree, oResourceGroup.Name
  51. Set oResourceGroup = Nothing
  52. Next
  53. End Sub
  54. Sub ListTheResources(oGroup As ClusResGroup, ClusTree As TreeView, Key As String)
  55. Dim oResources As ClusResources
  56. Set oResources = oGroup.Resources
  57. Dim oResource As ClusResource
  58. Dim i As Integer
  59. Dim nCount As Integer
  60. nCount = oResources.Count
  61. Dim ChildNode As Node
  62. For i = 1 To nCount
  63. Set oResource = oResources(i)
  64. Set ChildNode = ClusTree.Nodes.Add(Key, tvwChild, oResource.Name, oResource.Name)
  65. ChildNode.Tag = "Resource"
  66. Set oResource = Nothing
  67. Next
  68. End Sub
  69. Sub ListTheResourceTypes(oCluster As Cluster, ClusTree As TreeView)
  70. Dim oResourceTypes As ClusResTypes
  71. Set oResourceTypes = oCluster.ResourceTypes
  72. Dim oResourceType As ClusResType
  73. Dim i As Integer
  74. Dim nCount As Integer
  75. nCount = oResourceTypes.Count
  76. ClusTree.Nodes.Add , tvwChild, "Types", "Resource Types"
  77. Dim ChildNode As Node
  78. For i = 1 To nCount
  79. Set oResourceType = oResourceTypes(i)
  80. Set ChildNode = ClusTree.Nodes.Add("Types", tvwChild, , oResourceType.Name)
  81. ChildNode.Tag = "Type"
  82. Set oResourceType = Nothing
  83. Next
  84. End Sub
  85. Sub ListProperties(oProps As ClusProperties, lstView As ListView)
  86. Dim i As Integer
  87. Dim nCount As Integer
  88. Dim oProp As ClusProperty
  89. nCount = oProps.Count
  90. lstView.ListItems.Clear
  91. Dim lstItem As ListItem
  92. For i = 1 To nCount
  93. Set oProp = oProps(i)
  94. Set lstItem = lstView.ListItems.Add(i, , oProp.Name)
  95. lstItem.SubItems(1) = oProp.Value
  96. Set oProp = Nothing
  97. Next
  98. End Sub