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.

193 lines
4.9 KiB

  1. VERSION 5.00
  2. Begin VB.Form AdminScopes
  3. Caption = "Scope Administration"
  4. ClientHeight = 3204
  5. ClientLeft = 5148
  6. ClientTop = 4212
  7. ClientWidth = 4680
  8. LinkTopic = "Form1"
  9. ScaleHeight = 3204
  10. ScaleWidth = 4680
  11. Begin VB.TextBox ScopeName
  12. Height = 375
  13. Left = 3120
  14. TabIndex = 9
  15. Top = 960
  16. Visible = 0 'False
  17. Width = 1095
  18. End
  19. Begin VB.TextBox CatName
  20. Height = 375
  21. Left = 3120
  22. TabIndex = 8
  23. Top = 240
  24. Visible = 0 'False
  25. Width = 1095
  26. End
  27. Begin VB.CommandButton Cancel
  28. Caption = "Cancel"
  29. Height = 495
  30. Left = 2400
  31. TabIndex = 7
  32. Top = 2400
  33. Width = 1455
  34. End
  35. Begin VB.CommandButton Ok
  36. Caption = "Ok"
  37. Height = 495
  38. Left = 360
  39. TabIndex = 6
  40. Top = 2400
  41. Width = 1575
  42. End
  43. Begin VB.OptionButton IncRescanSel
  44. Caption = "IncRescanSel"
  45. Height = 255
  46. Left = 240
  47. TabIndex = 4
  48. Top = 1440
  49. Width = 255
  50. End
  51. Begin VB.OptionButton FullRescanSel
  52. Caption = "FullRescanSel"
  53. Height = 195
  54. Left = 240
  55. TabIndex = 1
  56. Top = 840
  57. Width = 255
  58. End
  59. Begin VB.OptionButton RemoveScopeSel
  60. Caption = "RemoveScopeSel"
  61. Height = 195
  62. Left = 240
  63. TabIndex = 0
  64. Top = 240
  65. Width = 255
  66. End
  67. Begin VB.Label IncRescan
  68. Caption = " Incremental Rescan"
  69. Height = 255
  70. Left = 840
  71. TabIndex = 5
  72. Top = 1440
  73. Width = 1815
  74. End
  75. Begin VB.Label Rescan
  76. Caption = "Full Rescan"
  77. Height = 255
  78. Left = 840
  79. TabIndex = 3
  80. Top = 840
  81. Width = 1815
  82. End
  83. Begin VB.Label RemoveScope
  84. Caption = "Remove Directory"
  85. Height = 255
  86. Left = 840
  87. TabIndex = 2
  88. Top = 240
  89. Width = 1695
  90. End
  91. End
  92. Attribute VB_Name = "AdminScopes"
  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 Form
  116. Private Sub Cancel_Click()
  117. Unload Me
  118. End Sub
  119. Private Sub Ok_Click()
  120. Call ProcessScopeAdminForm
  121. Unload Me
  122. End Sub
  123. Private Sub ProcessScopeAdminForm()
  124. If (RemoveScopeSel.Value) Then
  125. Call RemoveScopeMethod
  126. ElseIf (FullRescanSel.Value) Then
  127. Call StartFullRescan
  128. ElseIf (IncRescanSel.Value) Then
  129. Call StartIncRescan
  130. End If
  131. End Sub
  132. Private Sub RemoveScopeMethod()
  133. On Error GoTo ErrorHandler
  134. Dim CiCatalog As Object
  135. Set CiCatalog = ISAdminForm.gCiAdmin.GetCatalogByName(CatName)
  136. CiCatalog.RemoveScope (ScopeName)
  137. ErrorHandler:
  138. Set CiCatalog = Nothing
  139. If (Err.Number) Then
  140. MsgBox (Err.Description)
  141. End If
  142. End Sub
  143. Private Sub StartIncRescan()
  144. On Error GoTo ErrorHandler
  145. Dim CiCatalog As Object
  146. Dim CiScope As Object
  147. Set CiCatalog = ISAdminForm.gCiAdmin.GetCatalogByName(CatName)
  148. Set CiScope = CiCatalog.GetScopeByPath(ScopeName)
  149. CiScope.Rescan False
  150. ErrorHandler:
  151. Set CiCatalog = Nothing
  152. Set CiScope = Nothing
  153. If (Err.Number) Then
  154. MsgBox (Err.Description)
  155. End If
  156. End Sub
  157. Private Sub StartFullRescan()
  158. On Error GoTo ErrorHandler
  159. Dim CiCatalog As Object
  160. Dim CiScope As Object
  161. Set CiCatalog = ISAdminForm.gCiAdmin.GetCatalogByName(CatName)
  162. Set CiScope = CiCatalog.GetScopeByPath(ScopeName)
  163. CiScope.Rescan True
  164. ErrorHandler:
  165. Set CiCatalog = Nothing
  166. Set CiScope = Nothing
  167. If (Err.Number) Then
  168. MsgBox (Err.Description)
  169. End If
  170. End Sub