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.

206 lines
5.1 KiB

  1. VERSION 5.00
  2. Begin VB.Form AdminCatalog
  3. Caption = "Catalog Administration"
  4. ClientHeight = 3600
  5. ClientLeft = 5580
  6. ClientTop = 4752
  7. ClientWidth = 3840
  8. LinkTopic = "Form1"
  9. ScaleHeight = 3600
  10. ScaleWidth = 3840
  11. Begin VB.OptionButton ScanAllScopesOption
  12. Caption = "Option1"
  13. Height = 255
  14. Left = 360
  15. TabIndex = 9
  16. Top = 360
  17. Width = 255
  18. End
  19. Begin VB.OptionButton RemoveCatalogOption
  20. Caption = "Option1"
  21. Height = 255
  22. Left = 360
  23. TabIndex = 6
  24. Top = 2160
  25. Width = 255
  26. End
  27. Begin VB.CommandButton Cancel
  28. Caption = "Cancel"
  29. Height = 495
  30. Left = 2160
  31. TabIndex = 5
  32. Top = 2760
  33. Width = 1215
  34. End
  35. Begin VB.CommandButton Ok
  36. Caption = "Ok"
  37. Height = 495
  38. Left = 360
  39. TabIndex = 4
  40. Top = 2760
  41. Width = 1215
  42. End
  43. Begin VB.OptionButton ForceMasterMergeOption
  44. Caption = "Force Master Merge"
  45. Height = 195
  46. Left = 360
  47. TabIndex = 1
  48. Top = 960
  49. Width = 255
  50. End
  51. Begin VB.OptionButton CreateNewScopeOption
  52. Caption = "CreateNewScope"
  53. Height = 195
  54. Left = 360
  55. TabIndex = 0
  56. Top = 1560
  57. Width = 255
  58. End
  59. Begin VB.Label ScanAll
  60. Caption = "Force Full Rescan"
  61. Height = 255
  62. Left = 960
  63. TabIndex = 8
  64. Top = 360
  65. Width = 1335
  66. End
  67. Begin VB.Label RemoveCatalog
  68. Caption = "Remove Catalog"
  69. Height = 255
  70. Left = 960
  71. TabIndex = 7
  72. Top = 2160
  73. Width = 1575
  74. End
  75. Begin VB.Label ForceMasterMerge
  76. Caption = "Force Master Merge"
  77. Height = 195
  78. Left = 960
  79. TabIndex = 3
  80. Top = 960
  81. Width = 1425
  82. End
  83. Begin VB.Label AddScopeOption
  84. Caption = "Create New Directory"
  85. Height = 255
  86. Left = 960
  87. TabIndex = 2
  88. Top = 1560
  89. Width = 1575
  90. End
  91. End
  92. Attribute VB_Name = "AdminCatalog"
  93. Attribute VB_GlobalNameSpace = False
  94. Attribute VB_Creatable = False
  95. Attribute VB_PredeclaredId = True
  96. Attribute VB_Exposed = False
  97. '+-------------------------------------------------------------------------
  98. '
  99. ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  100. ' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  101. ' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  102. ' PARTICULAR PURPOSE.
  103. '
  104. ' Copyright 1998-1999, Microsoft Corporation. All Rights Reserved.
  105. '
  106. ' PROGRAM: VBAdmin
  107. '
  108. ' PURPOSE: Illustrates how to administer Indexing Service
  109. ' using Visual Basic and the Admin Helper API.
  110. '
  111. ' PLATFORM: Windows 2000
  112. '
  113. '--------------------------------------------------------------------------
  114. Option Explicit
  115. Public gScopeInfoPage As ScopeInfo
  116. Private Sub Cancel_Click()
  117. Unload Me
  118. End Sub
  119. Private Sub AddScopeMethod()
  120. Set gScopeInfoPage = New ScopeInfo
  121. gScopeInfoPage.Tag = Tag
  122. gScopeInfoPage.Show vbModal
  123. End Sub
  124. Private Sub RemoveCatalogMethod()
  125. On Error GoTo ErrorHandler
  126. ISAdminForm.gCiAdmin.RemoveCatalog Tag, True
  127. ErrorHandler:
  128. If (Err.Number) Then
  129. MsgBox (Err.Description)
  130. End If
  131. Call ISAdminForm.Connect_Click
  132. End Sub
  133. Private Sub Ok_Click()
  134. If (CreateNewScopeOption.Value) Then
  135. Call AddScopeMethod
  136. ElseIf (ForceMasterMergeOption.Value) Then
  137. Call ForceMasterMergeMethod
  138. ElseIf (ScanAllScopesOption.Value) Then
  139. Call ScanAllScopes
  140. ElseIf (RemoveCatalogOption.Value) Then
  141. Call RemoveCatalogMethod
  142. End If
  143. Unload Me
  144. End Sub
  145. Private Sub ForceMasterMergeMethod()
  146. On Error GoTo ErrorHandler
  147. Dim CiCatalog As Object
  148. Set CiCatalog = ISAdminForm.gCiAdmin.GetCatalogByName(Tag)
  149. CiCatalog.ForceMasterMerge
  150. ErrorHandler:
  151. Set CiCatalog = Nothing
  152. If (Err.Number) Then
  153. MsgBox (Err.Description)
  154. End If
  155. End Sub
  156. Private Sub ScanAllScopes()
  157. On Error GoTo ErrorHandler
  158. Dim CiCatalog As Object
  159. Dim CiScope As Object
  160. Dim fFound As Boolean
  161. Set CiCatalog = ISAdminForm.gCiAdmin.GetCatalogByName(Tag)
  162. fFound = CiCatalog.FindFirstScope
  163. While (fFound)
  164. Set CiScope = CiCatalog.GetScope()
  165. CiScope.Rescan True ' Full rescan.
  166. Set CiScope = Nothing
  167. fFound = CiCatalog.FindNextScope
  168. Wend
  169. ErrorHandler:
  170. Set CiCatalog = Nothing
  171. Set CiScope = Nothing
  172. If (Err.Number) Then
  173. MsgBox (Err.Description)
  174. End If
  175. End Sub