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.

2836 lines
125 KiB

  1. Imports CMI
  2. Public Class Form1
  3. Inherits System.Windows.Forms.Form
  4. #Region " CMI Constants "
  5. 'I copied these from the dependancy cooker app
  6. Public Const RESTYPE_FILE As String = "{E66B49F6-4A35-4246-87E8-5C1A468315B5}"
  7. Public Const RESTYPE_REGKEY As String = "{2C10DB69-39AB-48a4-A83F-9AB3ACBA7C45}"
  8. Public Const RESTYPE_BIGREGKEY As String = "{7D890061-6DFE-4d86-BA1D-125FD565C64F}"
  9. Public Const RESTYPE_RAWDEP As String = "{90D8E195-E710-4af6-B667-B1805FFC9B8F}"
  10. Public Const RESTYPE_BRANCH As String = "{7E47C1D7-34D6-4946-A738-E5E278BBD7D3}"
  11. Public Const RESTYPE_PNPID As String = "{AFC59066-28EA-4279-979B-955C9E8DE82A}"
  12. Public Const RESTYPE_SERVICE As String = "{5C16ED57-3182-4411-8EA7-AC1CE70B96DA}"
  13. Public Const RESTYPE_FBREGDLL As String = "{322D2CA9-219E-4380-989B-12E8A830DFFA}"
  14. Public Const ICON_Component As Integer = 133
  15. Public Const ICON_Group As Integer = 141
  16. #End Region
  17. #Region " Our Constants and Enums "
  18. Enum NodeImageIDs As Byte
  19. Unknown
  20. Component
  21. Group
  22. File
  23. Registry
  24. ComponentDisabled
  25. Note
  26. End Enum
  27. Enum CMIObjectTypes As Byte
  28. Unknown = NodeImageIDs.Unknown
  29. Component = NodeImageIDs.Component
  30. Group = NodeImageIDs.Group
  31. End Enum
  32. Public Enum DependencyModes As Byte
  33. ' process this component and any components selected because of it
  34. ' (i.e. cascade the operation regardless of dependencies)
  35. IgnoreAll = 2
  36. ' process this component regardless of dependencies, but only
  37. ' process children who are no longer depended upon.
  38. IgnoreOne = 1
  39. ' process this component and its children only if they are no
  40. ' longer depended upon.
  41. IgnoreNone = 0
  42. End Enum
  43. #End Region
  44. #Region " Our Fields, Sets, and Hashtables "
  45. Public WithEvents CMI As CMI.CMI
  46. Dim Filenames As Hashtable
  47. ' These three hashtables map objects' GUIDs to true/false values indicating
  48. ' whether or not the object is selected or excluded. That is, these are
  49. ' _not_ just sets.
  50. Dim SelectedComponents As Hashtable
  51. Dim ExcludedComponents As Hashtable
  52. Dim SelectedGroups As Hashtable
  53. Dim SatisfiedGroups As Hashtable
  54. Dim XFilename2Node As Hashtable
  55. Dim XNode2Component As Hashtable
  56. Dim XObject2NodeList As Hashtable
  57. Dim XComponent2SelectedComponentNode As Hashtable
  58. Dim XSelectedComponentNode2Component As Hashtable
  59. Dim XFilename2ComponentList As Hashtable
  60. Dim XComponent2FilenameList As Hashtable
  61. Dim XObject2DependencyTreeNode As Hashtable
  62. Dim XComponent2DependerList As Hashtable
  63. Dim XGroup2GroupNode As Hashtable
  64. Dim XGroupNode2Group As Hashtable
  65. Dim ObjectNames As Hashtable
  66. #End Region
  67. #Region " Friends WithEvents "
  68. Friend WithEvents FilenamesGroup As System.Windows.Forms.GroupBox
  69. Friend WithEvents Panel4 As System.Windows.Forms.Panel
  70. Friend WithEvents Splitter1 As System.Windows.Forms.Splitter
  71. Friend WithEvents ToolTips As System.Windows.Forms.ToolTip
  72. Friend WithEvents SelectedComponentsContextMenu As System.Windows.Forms.ContextMenu
  73. Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
  74. Friend WithEvents RemoveAllComponentsCmd As System.Windows.Forms.MenuItem
  75. Friend WithEvents RemoveComponentCmd As System.Windows.Forms.MenuItem
  76. Friend WithEvents RefreshSelectedComponentsCmd As System.Windows.Forms.MenuItem
  77. Friend WithEvents TabControl1 As System.Windows.Forms.TabControl
  78. Friend WithEvents BaseTab As System.Windows.Forms.TabPage
  79. Friend WithEvents FullTab As System.Windows.Forms.TabPage
  80. Friend WithEvents FilenameList As System.Windows.Forms.ListBox
  81. Friend WithEvents Panel12 As System.Windows.Forms.Panel
  82. Friend WithEvents Panel1 As System.Windows.Forms.Panel
  83. Friend WithEvents CMIServerName As System.Windows.Forms.ComboBox
  84. Friend WithEvents Label1 As System.Windows.Forms.Label
  85. Friend WithEvents Panel2 As System.Windows.Forms.Panel
  86. Friend WithEvents TreeTabs As System.Windows.Forms.TabControl
  87. Friend WithEvents GroupTab As System.Windows.Forms.TabPage
  88. Friend WithEvents GroupList As System.Windows.Forms.TreeView
  89. Friend WithEvents Panel10 As System.Windows.Forms.Panel
  90. Friend WithEvents InstanceTab As System.Windows.Forms.TabPage
  91. Friend WithEvents InstanceTree As System.Windows.Forms.TreeView
  92. Friend WithEvents DepTreeTab As System.Windows.Forms.TabPage
  93. Friend WithEvents Panel5 As System.Windows.Forms.Panel
  94. Friend WithEvents SelectedComponentTree As System.Windows.Forms.TreeView
  95. Friend WithEvents Panel3 As System.Windows.Forms.Panel
  96. Friend WithEvents SLXPath As System.Windows.Forms.TextBox
  97. Friend WithEvents SaveSLX As System.Windows.Forms.Button
  98. Friend WithEvents LoadSLX As System.Windows.Forms.Button
  99. Friend WithEvents MissingFilesTab As System.Windows.Forms.TabPage
  100. Friend WithEvents Panel6 As System.Windows.Forms.Panel
  101. Friend WithEvents MissingFilesList As System.Windows.Forms.ListBox
  102. Friend WithEvents Panel7 As System.Windows.Forms.Panel
  103. Friend WithEvents RefreshMissingFiles As System.Windows.Forms.Button
  104. Friend WithEvents MissingFilesPath As System.Windows.Forms.TextBox
  105. Friend WithEvents SaveMissingFilesList As System.Windows.Forms.Button
  106. Friend WithEvents ByFileTab As System.Windows.Forms.TabPage
  107. Friend WithEvents Panel11 As System.Windows.Forms.Panel
  108. Friend WithEvents FindComponents As System.Windows.Forms.Button
  109. Friend WithEvents ExtraFilesTab As System.Windows.Forms.TabPage
  110. Friend WithEvents Panel8 As System.Windows.Forms.Panel
  111. Friend WithEvents ExtraFilesList As System.Windows.Forms.ListBox
  112. Friend WithEvents Panel9 As System.Windows.Forms.Panel
  113. Friend WithEvents RefreshExtraFiles As System.Windows.Forms.Button
  114. Friend WithEvents ExtraFilesPath As System.Windows.Forms.TextBox
  115. Friend WithEvents SaveExtraFiles As System.Windows.Forms.Button
  116. Friend WithEvents FindProgress As System.Windows.Forms.ProgressBar
  117. Friend WithEvents FullFileList As System.Windows.Forms.ListBox
  118. Friend WithEvents ExclusionTab As System.Windows.Forms.TabPage
  119. Friend WithEvents ExcludeCmd As System.Windows.Forms.MenuItem
  120. Friend WithEvents ConfigurationTab As System.Windows.Forms.TabPage
  121. Friend WithEvents BuildImage As System.Windows.Forms.Button
  122. Friend WithEvents BuildPath As System.Windows.Forms.TextBox
  123. Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
  124. Friend WithEvents ShowComponentPropertiesCmd As System.Windows.Forms.MenuItem
  125. Friend WithEvents AutoUncook As System.Windows.Forms.CheckBox
  126. Friend WithEvents UsePlaceholders As System.Windows.Forms.CheckBox
  127. Friend WithEvents Panel13 As System.Windows.Forms.Panel
  128. Friend WithEvents ExpandNewNodes As System.Windows.Forms.CheckBox
  129. Friend WithEvents ShowMovedNodes As System.Windows.Forms.CheckBox
  130. Friend WithEvents Panel14 As System.Windows.Forms.Panel
  131. Friend WithEvents DependencyTree As System.Windows.Forms.TreeView
  132. Friend WithEvents ExpandAllCmd As System.Windows.Forms.MenuItem
  133. Friend WithEvents CollapseAllCmd As System.Windows.Forms.MenuItem
  134. Friend WithEvents NodeImages As System.Windows.Forms.ImageList
  135. Friend WithEvents PrintDocument As System.Drawing.Printing.PrintDocument
  136. Friend WithEvents Panel15 As System.Windows.Forms.Panel
  137. Friend WithEvents Panel16 As System.Windows.Forms.Panel
  138. Friend WithEvents Panel17 As System.Windows.Forms.Panel
  139. Friend WithEvents Panel19 As System.Windows.Forms.Panel
  140. Friend WithEvents StatusBarGroup As System.Windows.Forms.StatusBar
  141. Friend WithEvents LogStatus As System.Windows.Forms.StatusBarPanel
  142. Friend WithEvents StatusBar As System.Windows.Forms.StatusBarPanel
  143. Friend WithEvents ServerStatus As System.Windows.Forms.StatusBarPanel
  144. Friend WithEvents KeepAllFileLists As System.Windows.Forms.CheckBox
  145. Friend WithEvents Panel18 As System.Windows.Forms.Panel
  146. Friend WithEvents ExcludedTree As System.Windows.Forms.TreeView
  147. Friend WithEvents Panel20 As System.Windows.Forms.Panel
  148. Friend WithEvents PreExcludedList As System.Windows.Forms.ListBox
  149. Friend WithEvents Splitter2 As System.Windows.Forms.Splitter
  150. Friend WithEvents AutoCull As System.Windows.Forms.Button
  151. Friend WithEvents FilenameTree As System.Windows.Forms.TreeView
  152. Friend WithEvents MenuHeader As System.Windows.Forms.MenuItem
  153. Friend WithEvents MenuItem4 As System.Windows.Forms.MenuItem
  154. Friend WithEvents GetGroupsButton As System.Windows.Forms.Button
  155. #End Region
  156. #Region " Windows Form Designer generated code "
  157. Public Sub New()
  158. MyBase.New()
  159. 'This call is required by the Windows Form Designer.
  160. InitializeComponent()
  161. 'Add any initialization after the InitializeComponent() call
  162. InitHashes()
  163. InitForm()
  164. End Sub
  165. 'Form overrides dispose to clean up the component list.
  166. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  167. If disposing Then
  168. If Not (components Is Nothing) Then
  169. components.Dispose()
  170. End If
  171. End If
  172. MyBase.Dispose(disposing)
  173. End Sub
  174. Private components As System.ComponentModel.IContainer
  175. 'Required by the Windows Form Designer
  176. 'NOTE: The following procedure is required by the Windows Form Designer
  177. 'It can be modified using the Windows Form Designer.
  178. 'Do not modify it using the code editor.
  179. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  180. Me.components = New System.ComponentModel.Container()
  181. Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
  182. Me.RefreshExtraFiles = New System.Windows.Forms.Button()
  183. Me.Label1 = New System.Windows.Forms.Label()
  184. Me.FullTab = New System.Windows.Forms.TabPage()
  185. Me.FullFileList = New System.Windows.Forms.ListBox()
  186. Me.LogStatus = New System.Windows.Forms.StatusBarPanel()
  187. Me.SLXPath = New System.Windows.Forms.TextBox()
  188. Me.InstanceTree = New System.Windows.Forms.TreeView()
  189. Me.NodeImages = New System.Windows.Forms.ImageList(Me.components)
  190. Me.ExcludedTree = New System.Windows.Forms.TreeView()
  191. Me.MissingFilesTab = New System.Windows.Forms.TabPage()
  192. Me.Panel6 = New System.Windows.Forms.Panel()
  193. Me.MissingFilesList = New System.Windows.Forms.ListBox()
  194. Me.Panel7 = New System.Windows.Forms.Panel()
  195. Me.RefreshMissingFiles = New System.Windows.Forms.Button()
  196. Me.MissingFilesPath = New System.Windows.Forms.TextBox()
  197. Me.SaveMissingFilesList = New System.Windows.Forms.Button()
  198. Me.Panel20 = New System.Windows.Forms.Panel()
  199. Me.Splitter2 = New System.Windows.Forms.Splitter()
  200. Me.PreExcludedList = New System.Windows.Forms.ListBox()
  201. Me.ExtraFilesPath = New System.Windows.Forms.TextBox()
  202. Me.GroupTab = New System.Windows.Forms.TabPage()
  203. Me.GroupList = New System.Windows.Forms.TreeView()
  204. Me.SelectedComponentsContextMenu = New System.Windows.Forms.ContextMenu()
  205. Me.ShowComponentPropertiesCmd = New System.Windows.Forms.MenuItem()
  206. Me.MenuItem1 = New System.Windows.Forms.MenuItem()
  207. Me.RemoveComponentCmd = New System.Windows.Forms.MenuItem()
  208. Me.ExcludeCmd = New System.Windows.Forms.MenuItem()
  209. Me.MenuItem2 = New System.Windows.Forms.MenuItem()
  210. Me.ExpandAllCmd = New System.Windows.Forms.MenuItem()
  211. Me.CollapseAllCmd = New System.Windows.Forms.MenuItem()
  212. Me.RemoveAllComponentsCmd = New System.Windows.Forms.MenuItem()
  213. Me.RefreshSelectedComponentsCmd = New System.Windows.Forms.MenuItem()
  214. Me.Panel10 = New System.Windows.Forms.Panel()
  215. Me.GetGroupsButton = New System.Windows.Forms.Button()
  216. Me.InstanceTab = New System.Windows.Forms.TabPage()
  217. Me.FindComponents = New System.Windows.Forms.Button()
  218. Me.FilenameTree = New System.Windows.Forms.TreeView()
  219. Me.TreeTabs = New System.Windows.Forms.TabControl()
  220. Me.ConfigurationTab = New System.Windows.Forms.TabPage()
  221. Me.Panel5 = New System.Windows.Forms.Panel()
  222. Me.SelectedComponentTree = New System.Windows.Forms.TreeView()
  223. Me.Panel3 = New System.Windows.Forms.Panel()
  224. Me.AutoCull = New System.Windows.Forms.Button()
  225. Me.BuildPath = New System.Windows.Forms.TextBox()
  226. Me.BuildImage = New System.Windows.Forms.Button()
  227. Me.SaveSLX = New System.Windows.Forms.Button()
  228. Me.LoadSLX = New System.Windows.Forms.Button()
  229. Me.ByFileTab = New System.Windows.Forms.TabPage()
  230. Me.Panel15 = New System.Windows.Forms.Panel()
  231. Me.Panel11 = New System.Windows.Forms.Panel()
  232. Me.DepTreeTab = New System.Windows.Forms.TabPage()
  233. Me.Panel14 = New System.Windows.Forms.Panel()
  234. Me.DependencyTree = New System.Windows.Forms.TreeView()
  235. Me.Panel13 = New System.Windows.Forms.Panel()
  236. Me.ShowMovedNodes = New System.Windows.Forms.CheckBox()
  237. Me.ExpandNewNodes = New System.Windows.Forms.CheckBox()
  238. Me.ExtraFilesTab = New System.Windows.Forms.TabPage()
  239. Me.Panel8 = New System.Windows.Forms.Panel()
  240. Me.ExtraFilesList = New System.Windows.Forms.ListBox()
  241. Me.Panel9 = New System.Windows.Forms.Panel()
  242. Me.SaveExtraFiles = New System.Windows.Forms.Button()
  243. Me.ExclusionTab = New System.Windows.Forms.TabPage()
  244. Me.Panel18 = New System.Windows.Forms.Panel()
  245. Me.Panel19 = New System.Windows.Forms.Panel()
  246. Me.StatusBarGroup = New System.Windows.Forms.StatusBar()
  247. Me.StatusBar = New System.Windows.Forms.StatusBarPanel()
  248. Me.ServerStatus = New System.Windows.Forms.StatusBarPanel()
  249. Me.Panel16 = New System.Windows.Forms.Panel()
  250. Me.Panel17 = New System.Windows.Forms.Panel()
  251. Me.Panel12 = New System.Windows.Forms.Panel()
  252. Me.Panel2 = New System.Windows.Forms.Panel()
  253. Me.Panel1 = New System.Windows.Forms.Panel()
  254. Me.KeepAllFileLists = New System.Windows.Forms.CheckBox()
  255. Me.UsePlaceholders = New System.Windows.Forms.CheckBox()
  256. Me.AutoUncook = New System.Windows.Forms.CheckBox()
  257. Me.CMIServerName = New System.Windows.Forms.ComboBox()
  258. Me.FindProgress = New System.Windows.Forms.ProgressBar()
  259. Me.Panel4 = New System.Windows.Forms.Panel()
  260. Me.TabControl1 = New System.Windows.Forms.TabControl()
  261. Me.BaseTab = New System.Windows.Forms.TabPage()
  262. Me.FilenameList = New System.Windows.Forms.ListBox()
  263. Me.FilenamesGroup = New System.Windows.Forms.GroupBox()
  264. Me.PrintDocument = New System.Drawing.Printing.PrintDocument()
  265. Me.ToolTips = New System.Windows.Forms.ToolTip(Me.components)
  266. Me.Splitter1 = New System.Windows.Forms.Splitter()
  267. Me.MenuHeader = New System.Windows.Forms.MenuItem()
  268. Me.MenuItem4 = New System.Windows.Forms.MenuItem()
  269. Me.FullTab.SuspendLayout()
  270. CType(Me.LogStatus, System.ComponentModel.ISupportInitialize).BeginInit()
  271. Me.MissingFilesTab.SuspendLayout()
  272. Me.Panel6.SuspendLayout()
  273. Me.Panel7.SuspendLayout()
  274. Me.Panel20.SuspendLayout()
  275. Me.GroupTab.SuspendLayout()
  276. Me.Panel10.SuspendLayout()
  277. Me.InstanceTab.SuspendLayout()
  278. Me.TreeTabs.SuspendLayout()
  279. Me.ConfigurationTab.SuspendLayout()
  280. Me.Panel5.SuspendLayout()
  281. Me.Panel3.SuspendLayout()
  282. Me.ByFileTab.SuspendLayout()
  283. Me.Panel15.SuspendLayout()
  284. Me.Panel11.SuspendLayout()
  285. Me.DepTreeTab.SuspendLayout()
  286. Me.Panel14.SuspendLayout()
  287. Me.Panel13.SuspendLayout()
  288. Me.ExtraFilesTab.SuspendLayout()
  289. Me.Panel8.SuspendLayout()
  290. Me.Panel9.SuspendLayout()
  291. Me.ExclusionTab.SuspendLayout()
  292. Me.Panel18.SuspendLayout()
  293. Me.Panel19.SuspendLayout()
  294. CType(Me.StatusBar, System.ComponentModel.ISupportInitialize).BeginInit()
  295. CType(Me.ServerStatus, System.ComponentModel.ISupportInitialize).BeginInit()
  296. Me.Panel16.SuspendLayout()
  297. Me.Panel12.SuspendLayout()
  298. Me.Panel2.SuspendLayout()
  299. Me.Panel1.SuspendLayout()
  300. Me.Panel4.SuspendLayout()
  301. Me.TabControl1.SuspendLayout()
  302. Me.BaseTab.SuspendLayout()
  303. Me.FilenamesGroup.SuspendLayout()
  304. Me.SuspendLayout()
  305. '
  306. 'RefreshExtraFiles
  307. '
  308. Me.RefreshExtraFiles.Location = New System.Drawing.Point(8, 8)
  309. Me.RefreshExtraFiles.Name = "RefreshExtraFiles"
  310. Me.RefreshExtraFiles.Size = New System.Drawing.Size(56, 23)
  311. Me.RefreshExtraFiles.TabIndex = 0
  312. Me.RefreshExtraFiles.Text = "Refresh"
  313. '
  314. 'Label1
  315. '
  316. Me.Label1.Location = New System.Drawing.Point(8, 0)
  317. Me.Label1.Name = "Label1"
  318. Me.Label1.Size = New System.Drawing.Size(56, 16)
  319. Me.Label1.TabIndex = 5
  320. Me.Label1.Text = "Server"
  321. Me.Label1.TextAlign = System.Drawing.ContentAlignment.BottomRight
  322. '
  323. 'FullTab
  324. '
  325. Me.FullTab.Controls.AddRange(New System.Windows.Forms.Control() {Me.FullFileList})
  326. Me.FullTab.Location = New System.Drawing.Point(4, 4)
  327. Me.FullTab.Name = "FullTab"
  328. Me.FullTab.Size = New System.Drawing.Size(88, 239)
  329. Me.FullTab.TabIndex = 1
  330. Me.FullTab.Text = "Full"
  331. '
  332. 'FullFileList
  333. '
  334. Me.FullFileList.Dock = System.Windows.Forms.DockStyle.Fill
  335. Me.FullFileList.Items.AddRange(New Object() {"dmboot.sys", "ksecdd.sys", "fastfat.sys", "ntfs.sys", "hal.dll", "halacpi.dll", "hal.dll", "halapic.dll", "halapic.dll", "hal.dll", "halaacpi.dll", "halaacpi.dll", "vga.sys", "cpqarray.sys", "atapi.sys", "aha154x.sys", "sparrow.sys", "symc810.sys", "aic78xx.sys", "i2omp.sys", "dac960nt.sys", "ql10wnt.sys", "amsint.sys", "asc.sys", "asc3550.sys", "mraid35x.sys", "ini910u.sys", "ql1240.sys", "tffsport.sys", "aic78u2.sys", "symc8xx.sys", "sym_hi.sys", "sym_u3.sys", "asc3350p.sys", "abp480n5.sys", "cd20xrnt.sys", "ultra.sys", "fasttrak.sys", "adpu160m.sys", "dpti2o.sys", "ql1080.sys", "ql1280.sys", "ql12160.sys", "perc2.sys", "hpn.sys", "afc9xxx.sys", "cbidf2k.sys", "dac2w2k.sys", "hpt3xx.sys", "afcnt.sys", "pci.sys", "acpi.sys", "isapnp.sys", "acpiec.sys", "ohci1394.sys", "pcmcia.sys", "pciide.sys", "intelide.sys", "viaide.sys", "cmdide.sys", "toside.sys", "aliide.sys", "mountmgr.sys", "ftdisk.sys", "partmgr.sys", "fdc.sys", "dmload.sys", "dmio.sys", "sbp2port.sys", "lbrtfdc.sys", "usbohci.sys", "usbuhci.sys", "usbhub.sys", "usbccgp.sys", "hidusb.sys", "serial.sys", "serenum.sys", "usbstor.sys", "i8042prt.sys", "kbdhid.sys", "cdrom.sys", "disk.sys", "sfloppy.sys", "ramdisk.sys", "flpydisk.sys", "fastfat.sys", "cdfs.sys", "mouclass.sys", "mouhid.sys"})
  336. Me.FullFileList.Name = "FullFileList"
  337. Me.FullFileList.ScrollAlwaysVisible = True
  338. Me.FullFileList.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended
  339. Me.FullFileList.Size = New System.Drawing.Size(88, 238)
  340. Me.FullFileList.TabIndex = 0
  341. '
  342. 'LogStatus
  343. '
  344. Me.LogStatus.BorderStyle = System.Windows.Forms.StatusBarPanelBorderStyle.None
  345. Me.LogStatus.Icon = CType(resources.GetObject("LogStatus.Icon"), System.Drawing.Icon)
  346. Me.LogStatus.Width = 20
  347. '
  348. 'SLXPath
  349. '
  350. Me.SLXPath.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
  351. Or System.Windows.Forms.AnchorStyles.Right)
  352. Me.SLXPath.Location = New System.Drawing.Point(136, 40)
  353. Me.SLXPath.Name = "SLXPath"
  354. Me.SLXPath.Size = New System.Drawing.Size(256, 20)
  355. Me.SLXPath.TabIndex = 1
  356. Me.SLXPath.Text = "D:\work\autogen.slx"
  357. '
  358. 'InstanceTree
  359. '
  360. Me.InstanceTree.Dock = System.Windows.Forms.DockStyle.Fill
  361. Me.InstanceTree.ImageList = Me.NodeImages
  362. Me.InstanceTree.Name = "InstanceTree"
  363. Me.InstanceTree.Size = New System.Drawing.Size(403, 160)
  364. Me.InstanceTree.TabIndex = 0
  365. '
  366. 'NodeImages
  367. '
  368. Me.NodeImages.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit
  369. Me.NodeImages.ImageSize = New System.Drawing.Size(16, 16)
  370. Me.NodeImages.ImageStream = CType(resources.GetObject("NodeImages.ImageStream"), System.Windows.Forms.ImageListStreamer)
  371. Me.NodeImages.TransparentColor = System.Drawing.Color.Transparent
  372. '
  373. 'ExcludedTree
  374. '
  375. Me.ExcludedTree.Dock = System.Windows.Forms.DockStyle.Fill
  376. Me.ExcludedTree.ImageList = Me.NodeImages
  377. Me.ExcludedTree.Name = "ExcludedTree"
  378. Me.ExcludedTree.Size = New System.Drawing.Size(403, 160)
  379. Me.ExcludedTree.TabIndex = 0
  380. '
  381. 'MissingFilesTab
  382. '
  383. Me.MissingFilesTab.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel6, Me.Panel7})
  384. Me.MissingFilesTab.Location = New System.Drawing.Point(4, 22)
  385. Me.MissingFilesTab.Name = "MissingFilesTab"
  386. Me.MissingFilesTab.Size = New System.Drawing.Size(403, 178)
  387. Me.MissingFilesTab.TabIndex = 1
  388. Me.MissingFilesTab.Text = "Missing Files"
  389. Me.MissingFilesTab.Visible = False
  390. '
  391. 'Panel6
  392. '
  393. Me.Panel6.Controls.AddRange(New System.Windows.Forms.Control() {Me.MissingFilesList})
  394. Me.Panel6.Dock = System.Windows.Forms.DockStyle.Fill
  395. Me.Panel6.Name = "Panel6"
  396. Me.Panel6.Size = New System.Drawing.Size(403, 146)
  397. Me.Panel6.TabIndex = 2
  398. '
  399. 'MissingFilesList
  400. '
  401. Me.MissingFilesList.Dock = System.Windows.Forms.DockStyle.Fill
  402. Me.MissingFilesList.Name = "MissingFilesList"
  403. Me.MissingFilesList.ScrollAlwaysVisible = True
  404. Me.MissingFilesList.Size = New System.Drawing.Size(403, 134)
  405. Me.MissingFilesList.TabIndex = 0
  406. '
  407. 'Panel7
  408. '
  409. Me.Panel7.Controls.AddRange(New System.Windows.Forms.Control() {Me.RefreshMissingFiles, Me.MissingFilesPath, Me.SaveMissingFilesList})
  410. Me.Panel7.Dock = System.Windows.Forms.DockStyle.Bottom
  411. Me.Panel7.Location = New System.Drawing.Point(0, 146)
  412. Me.Panel7.Name = "Panel7"
  413. Me.Panel7.Size = New System.Drawing.Size(403, 32)
  414. Me.Panel7.TabIndex = 1
  415. '
  416. 'RefreshMissingFiles
  417. '
  418. Me.RefreshMissingFiles.Location = New System.Drawing.Point(8, 8)
  419. Me.RefreshMissingFiles.Name = "RefreshMissingFiles"
  420. Me.RefreshMissingFiles.Size = New System.Drawing.Size(56, 23)
  421. Me.RefreshMissingFiles.TabIndex = 0
  422. Me.RefreshMissingFiles.Text = "Refresh"
  423. '
  424. 'MissingFilesPath
  425. '
  426. Me.MissingFilesPath.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
  427. Or System.Windows.Forms.AnchorStyles.Right)
  428. Me.MissingFilesPath.Location = New System.Drawing.Point(136, 8)
  429. Me.MissingFilesPath.Name = "MissingFilesPath"
  430. Me.MissingFilesPath.Size = New System.Drawing.Size(253, 20)
  431. Me.MissingFilesPath.TabIndex = 1
  432. Me.MissingFilesPath.Text = "D:\work\autogen-missing-files.txt"
  433. '
  434. 'SaveMissingFilesList
  435. '
  436. Me.SaveMissingFilesList.Location = New System.Drawing.Point(72, 8)
  437. Me.SaveMissingFilesList.Name = "SaveMissingFilesList"
  438. Me.SaveMissingFilesList.Size = New System.Drawing.Size(56, 23)
  439. Me.SaveMissingFilesList.TabIndex = 0
  440. Me.SaveMissingFilesList.Text = "Save"
  441. '
  442. 'Panel20
  443. '
  444. Me.Panel20.Controls.AddRange(New System.Windows.Forms.Control() {Me.Splitter2, Me.PreExcludedList})
  445. Me.Panel20.Dock = System.Windows.Forms.DockStyle.Top
  446. Me.Panel20.Name = "Panel20"
  447. Me.Panel20.Size = New System.Drawing.Size(403, 72)
  448. Me.Panel20.TabIndex = 2
  449. '
  450. 'Splitter2
  451. '
  452. Me.Splitter2.Dock = System.Windows.Forms.DockStyle.Bottom
  453. Me.Splitter2.Location = New System.Drawing.Point(0, 69)
  454. Me.Splitter2.Name = "Splitter2"
  455. Me.Splitter2.Size = New System.Drawing.Size(403, 3)
  456. Me.Splitter2.TabIndex = 1
  457. Me.Splitter2.TabStop = False
  458. '
  459. 'PreExcludedList
  460. '
  461. Me.PreExcludedList.Dock = System.Windows.Forms.DockStyle.Fill
  462. Me.PreExcludedList.Items.AddRange(New Object() {"{F691200A-F5EA-49CE-8760-434723AF33D9}", "{CE1F15E6-8003-444D-B33A-6710B4744CD2}"})
  463. Me.PreExcludedList.Name = "PreExcludedList"
  464. Me.PreExcludedList.Size = New System.Drawing.Size(403, 69)
  465. Me.PreExcludedList.TabIndex = 0
  466. '
  467. 'ExtraFilesPath
  468. '
  469. Me.ExtraFilesPath.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
  470. Or System.Windows.Forms.AnchorStyles.Right)
  471. Me.ExtraFilesPath.Location = New System.Drawing.Point(136, 8)
  472. Me.ExtraFilesPath.Name = "ExtraFilesPath"
  473. Me.ExtraFilesPath.Size = New System.Drawing.Size(253, 20)
  474. Me.ExtraFilesPath.TabIndex = 1
  475. Me.ExtraFilesPath.Text = "D:\work\autogen-extra-files.txt"
  476. '
  477. 'GroupTab
  478. '
  479. Me.GroupTab.Controls.AddRange(New System.Windows.Forms.Control() {Me.GroupList, Me.Panel10})
  480. Me.GroupTab.Location = New System.Drawing.Point(4, 40)
  481. Me.GroupTab.Name = "GroupTab"
  482. Me.GroupTab.Size = New System.Drawing.Size(403, 160)
  483. Me.GroupTab.TabIndex = 2
  484. Me.GroupTab.Text = "Groups"
  485. '
  486. 'GroupList
  487. '
  488. Me.GroupList.CheckBoxes = True
  489. Me.GroupList.ContextMenu = Me.SelectedComponentsContextMenu
  490. Me.GroupList.Dock = System.Windows.Forms.DockStyle.Fill
  491. Me.GroupList.ImageList = Me.NodeImages
  492. Me.GroupList.Location = New System.Drawing.Point(0, 24)
  493. Me.GroupList.Name = "GroupList"
  494. Me.GroupList.Size = New System.Drawing.Size(403, 136)
  495. Me.GroupList.Sorted = True
  496. Me.GroupList.TabIndex = 1
  497. '
  498. 'SelectedComponentsContextMenu
  499. '
  500. Me.SelectedComponentsContextMenu.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuHeader, Me.MenuItem4, Me.ShowComponentPropertiesCmd, Me.MenuItem1, Me.RemoveComponentCmd, Me.ExcludeCmd, Me.MenuItem2, Me.ExpandAllCmd, Me.CollapseAllCmd, Me.RemoveAllComponentsCmd, Me.RefreshSelectedComponentsCmd})
  501. '
  502. 'ShowComponentPropertiesCmd
  503. '
  504. Me.ShowComponentPropertiesCmd.Index = 2
  505. Me.ShowComponentPropertiesCmd.Shortcut = System.Windows.Forms.Shortcut.ShiftF10
  506. Me.ShowComponentPropertiesCmd.Text = "Properties..."
  507. '
  508. 'MenuItem1
  509. '
  510. Me.MenuItem1.Index = 3
  511. Me.MenuItem1.Text = "-"
  512. '
  513. 'RemoveComponentCmd
  514. '
  515. Me.RemoveComponentCmd.Index = 4
  516. Me.RemoveComponentCmd.Text = "Remove"
  517. '
  518. 'ExcludeCmd
  519. '
  520. Me.ExcludeCmd.Index = 5
  521. Me.ExcludeCmd.Text = "Exclude"
  522. '
  523. 'MenuItem2
  524. '
  525. Me.MenuItem2.Index = 6
  526. Me.MenuItem2.Text = "-"
  527. '
  528. 'ExpandAllCmd
  529. '
  530. Me.ExpandAllCmd.Index = 7
  531. Me.ExpandAllCmd.Text = "Expand All"
  532. '
  533. 'CollapseAllCmd
  534. '
  535. Me.CollapseAllCmd.Index = 8
  536. Me.CollapseAllCmd.Text = "Collapse All"
  537. '
  538. 'RemoveAllComponentsCmd
  539. '
  540. Me.RemoveAllComponentsCmd.Index = 9
  541. Me.RemoveAllComponentsCmd.Text = "Remove All"
  542. '
  543. 'RefreshSelectedComponentsCmd
  544. '
  545. Me.RefreshSelectedComponentsCmd.Index = 10
  546. Me.RefreshSelectedComponentsCmd.Text = "Refresh List"
  547. '
  548. 'Panel10
  549. '
  550. Me.Panel10.Controls.AddRange(New System.Windows.Forms.Control() {Me.GetGroupsButton})
  551. Me.Panel10.Dock = System.Windows.Forms.DockStyle.Top
  552. Me.Panel10.DockPadding.All = 2
  553. Me.Panel10.Name = "Panel10"
  554. Me.Panel10.Size = New System.Drawing.Size(403, 24)
  555. Me.Panel10.TabIndex = 0
  556. '
  557. 'GetGroupsButton
  558. '
  559. Me.GetGroupsButton.Dock = System.Windows.Forms.DockStyle.Left
  560. Me.GetGroupsButton.Location = New System.Drawing.Point(2, 2)
  561. Me.GetGroupsButton.Name = "GetGroupsButton"
  562. Me.GetGroupsButton.Size = New System.Drawing.Size(75, 20)
  563. Me.GetGroupsButton.TabIndex = 0
  564. Me.GetGroupsButton.Text = "Get Groups"
  565. '
  566. 'InstanceTab
  567. '
  568. Me.InstanceTab.Controls.AddRange(New System.Windows.Forms.Control() {Me.InstanceTree})
  569. Me.InstanceTab.Location = New System.Drawing.Point(4, 40)
  570. Me.InstanceTab.Name = "InstanceTab"
  571. Me.InstanceTab.Size = New System.Drawing.Size(403, 160)
  572. Me.InstanceTab.TabIndex = 3
  573. Me.InstanceTab.Text = "Dependencies"
  574. Me.InstanceTab.Visible = False
  575. '
  576. 'FindComponents
  577. '
  578. Me.FindComponents.Dock = System.Windows.Forms.DockStyle.Left
  579. Me.FindComponents.FlatStyle = System.Windows.Forms.FlatStyle.System
  580. Me.FindComponents.Location = New System.Drawing.Point(2, 2)
  581. Me.FindComponents.Name = "FindComponents"
  582. Me.FindComponents.Size = New System.Drawing.Size(112, 20)
  583. Me.FindComponents.TabIndex = 3
  584. Me.FindComponents.Text = "Find Components"
  585. '
  586. 'FilenameTree
  587. '
  588. Me.FilenameTree.CheckBoxes = True
  589. Me.FilenameTree.Dock = System.Windows.Forms.DockStyle.Fill
  590. Me.FilenameTree.ImageList = Me.NodeImages
  591. Me.FilenameTree.Name = "FilenameTree"
  592. Me.FilenameTree.Size = New System.Drawing.Size(403, 136)
  593. Me.FilenameTree.Sorted = True
  594. Me.FilenameTree.TabIndex = 5
  595. '
  596. 'TreeTabs
  597. '
  598. Me.TreeTabs.Controls.AddRange(New System.Windows.Forms.Control() {Me.GroupTab, Me.ConfigurationTab, Me.ByFileTab, Me.DepTreeTab, Me.MissingFilesTab, Me.ExtraFilesTab, Me.ExclusionTab, Me.InstanceTab})
  599. Me.TreeTabs.Dock = System.Windows.Forms.DockStyle.Fill
  600. Me.TreeTabs.Location = New System.Drawing.Point(2, 2)
  601. Me.TreeTabs.Multiline = True
  602. Me.TreeTabs.Name = "TreeTabs"
  603. Me.TreeTabs.SelectedIndex = 0
  604. Me.TreeTabs.Size = New System.Drawing.Size(411, 204)
  605. Me.TreeTabs.TabIndex = 0
  606. '
  607. 'ConfigurationTab
  608. '
  609. Me.ConfigurationTab.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel5, Me.Panel3})
  610. Me.ConfigurationTab.Location = New System.Drawing.Point(4, 40)
  611. Me.ConfigurationTab.Name = "ConfigurationTab"
  612. Me.ConfigurationTab.Size = New System.Drawing.Size(403, 160)
  613. Me.ConfigurationTab.TabIndex = 1
  614. Me.ConfigurationTab.Text = "Configuration"
  615. Me.ConfigurationTab.Visible = False
  616. '
  617. 'Panel5
  618. '
  619. Me.Panel5.Controls.AddRange(New System.Windows.Forms.Control() {Me.SelectedComponentTree})
  620. Me.Panel5.Dock = System.Windows.Forms.DockStyle.Fill
  621. Me.Panel5.Name = "Panel5"
  622. Me.Panel5.Size = New System.Drawing.Size(403, 64)
  623. Me.Panel5.TabIndex = 2
  624. '
  625. 'SelectedComponentTree
  626. '
  627. Me.SelectedComponentTree.ContextMenu = Me.SelectedComponentsContextMenu
  628. Me.SelectedComponentTree.Dock = System.Windows.Forms.DockStyle.Fill
  629. Me.SelectedComponentTree.ImageList = Me.NodeImages
  630. Me.SelectedComponentTree.Name = "SelectedComponentTree"
  631. Me.SelectedComponentTree.Size = New System.Drawing.Size(403, 64)
  632. Me.SelectedComponentTree.Sorted = True
  633. Me.SelectedComponentTree.TabIndex = 0
  634. '
  635. 'Panel3
  636. '
  637. Me.Panel3.Controls.AddRange(New System.Windows.Forms.Control() {Me.AutoCull, Me.BuildPath, Me.BuildImage, Me.SLXPath, Me.SaveSLX, Me.LoadSLX})
  638. Me.Panel3.Dock = System.Windows.Forms.DockStyle.Bottom
  639. Me.Panel3.Location = New System.Drawing.Point(0, 64)
  640. Me.Panel3.Name = "Panel3"
  641. Me.Panel3.Size = New System.Drawing.Size(403, 96)
  642. Me.Panel3.TabIndex = 1
  643. '
  644. 'AutoCull
  645. '
  646. Me.AutoCull.Location = New System.Drawing.Point(8, 8)
  647. Me.AutoCull.Name = "AutoCull"
  648. Me.AutoCull.Size = New System.Drawing.Size(200, 23)
  649. Me.AutoCull.TabIndex = 5
  650. Me.AutoCull.Text = "Auto-Cull Configuration"
  651. '
  652. 'BuildPath
  653. '
  654. Me.BuildPath.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  655. Or System.Windows.Forms.AnchorStyles.Right)
  656. Me.BuildPath.Location = New System.Drawing.Point(136, 72)
  657. Me.BuildPath.Name = "BuildPath"
  658. Me.BuildPath.Size = New System.Drawing.Size(256, 20)
  659. Me.BuildPath.TabIndex = 4
  660. Me.BuildPath.Text = "D:\images\autogen"
  661. '
  662. 'BuildImage
  663. '
  664. Me.BuildImage.Location = New System.Drawing.Point(8, 72)
  665. Me.BuildImage.Name = "BuildImage"
  666. Me.BuildImage.Size = New System.Drawing.Size(120, 23)
  667. Me.BuildImage.TabIndex = 3
  668. Me.BuildImage.Text = "Build Target Image"
  669. '
  670. 'SaveSLX
  671. '
  672. Me.SaveSLX.Location = New System.Drawing.Point(72, 40)
  673. Me.SaveSLX.Name = "SaveSLX"
  674. Me.SaveSLX.Size = New System.Drawing.Size(56, 23)
  675. Me.SaveSLX.TabIndex = 0
  676. Me.SaveSLX.Text = "Save"
  677. '
  678. 'LoadSLX
  679. '
  680. Me.LoadSLX.Location = New System.Drawing.Point(8, 40)
  681. Me.LoadSLX.Name = "LoadSLX"
  682. Me.LoadSLX.Size = New System.Drawing.Size(56, 23)
  683. Me.LoadSLX.TabIndex = 0
  684. Me.LoadSLX.Text = "Load"
  685. '
  686. 'ByFileTab
  687. '
  688. Me.ByFileTab.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel15, Me.Panel11})
  689. Me.ByFileTab.Location = New System.Drawing.Point(4, 40)
  690. Me.ByFileTab.Name = "ByFileTab"
  691. Me.ByFileTab.Size = New System.Drawing.Size(403, 160)
  692. Me.ByFileTab.TabIndex = 0
  693. Me.ByFileTab.Text = "By File"
  694. Me.ByFileTab.Visible = False
  695. '
  696. 'Panel15
  697. '
  698. Me.Panel15.Controls.AddRange(New System.Windows.Forms.Control() {Me.FilenameTree})
  699. Me.Panel15.Dock = System.Windows.Forms.DockStyle.Fill
  700. Me.Panel15.Location = New System.Drawing.Point(0, 24)
  701. Me.Panel15.Name = "Panel15"
  702. Me.Panel15.Size = New System.Drawing.Size(403, 136)
  703. Me.Panel15.TabIndex = 7
  704. '
  705. 'Panel11
  706. '
  707. Me.Panel11.Controls.AddRange(New System.Windows.Forms.Control() {Me.FindComponents})
  708. Me.Panel11.Dock = System.Windows.Forms.DockStyle.Top
  709. Me.Panel11.DockPadding.All = 2
  710. Me.Panel11.Name = "Panel11"
  711. Me.Panel11.Size = New System.Drawing.Size(403, 24)
  712. Me.Panel11.TabIndex = 6
  713. '
  714. 'DepTreeTab
  715. '
  716. Me.DepTreeTab.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel14, Me.Panel13})
  717. Me.DepTreeTab.Location = New System.Drawing.Point(4, 22)
  718. Me.DepTreeTab.Name = "DepTreeTab"
  719. Me.DepTreeTab.Size = New System.Drawing.Size(403, 178)
  720. Me.DepTreeTab.TabIndex = 4
  721. Me.DepTreeTab.Text = "Dependency Tree"
  722. Me.DepTreeTab.Visible = False
  723. '
  724. 'Panel14
  725. '
  726. Me.Panel14.Controls.AddRange(New System.Windows.Forms.Control() {Me.DependencyTree})
  727. Me.Panel14.Dock = System.Windows.Forms.DockStyle.Fill
  728. Me.Panel14.Location = New System.Drawing.Point(0, 24)
  729. Me.Panel14.Name = "Panel14"
  730. Me.Panel14.Size = New System.Drawing.Size(403, 154)
  731. Me.Panel14.TabIndex = 2
  732. '
  733. 'DependencyTree
  734. '
  735. Me.DependencyTree.ContextMenu = Me.SelectedComponentsContextMenu
  736. Me.DependencyTree.Dock = System.Windows.Forms.DockStyle.Fill
  737. Me.DependencyTree.ImageList = Me.NodeImages
  738. Me.DependencyTree.Name = "DependencyTree"
  739. Me.DependencyTree.Size = New System.Drawing.Size(403, 154)
  740. Me.DependencyTree.TabIndex = 0
  741. '
  742. 'Panel13
  743. '
  744. Me.Panel13.Controls.AddRange(New System.Windows.Forms.Control() {Me.ShowMovedNodes, Me.ExpandNewNodes})
  745. Me.Panel13.Dock = System.Windows.Forms.DockStyle.Top
  746. Me.Panel13.DockPadding.All = 2
  747. Me.Panel13.Name = "Panel13"
  748. Me.Panel13.Size = New System.Drawing.Size(403, 24)
  749. Me.Panel13.TabIndex = 1
  750. '
  751. 'ShowMovedNodes
  752. '
  753. Me.ShowMovedNodes.Checked = True
  754. Me.ShowMovedNodes.CheckState = System.Windows.Forms.CheckState.Checked
  755. Me.ShowMovedNodes.Dock = System.Windows.Forms.DockStyle.Right
  756. Me.ShowMovedNodes.Location = New System.Drawing.Point(201, 2)
  757. Me.ShowMovedNodes.Name = "ShowMovedNodes"
  758. Me.ShowMovedNodes.Size = New System.Drawing.Size(200, 20)
  759. Me.ShowMovedNodes.TabIndex = 1
  760. Me.ShowMovedNodes.Text = "Expand to Show Moved Nodes"
  761. '
  762. 'ExpandNewNodes
  763. '
  764. Me.ExpandNewNodes.Dock = System.Windows.Forms.DockStyle.Left
  765. Me.ExpandNewNodes.Location = New System.Drawing.Point(2, 2)
  766. Me.ExpandNewNodes.Name = "ExpandNewNodes"
  767. Me.ExpandNewNodes.Size = New System.Drawing.Size(176, 20)
  768. Me.ExpandNewNodes.TabIndex = 0
  769. Me.ExpandNewNodes.Text = "Expand New Nodes"
  770. '
  771. 'ExtraFilesTab
  772. '
  773. Me.ExtraFilesTab.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel8, Me.Panel9})
  774. Me.ExtraFilesTab.Location = New System.Drawing.Point(4, 22)
  775. Me.ExtraFilesTab.Name = "ExtraFilesTab"
  776. Me.ExtraFilesTab.Size = New System.Drawing.Size(403, 178)
  777. Me.ExtraFilesTab.TabIndex = 1
  778. Me.ExtraFilesTab.Text = "Extra Files"
  779. Me.ExtraFilesTab.Visible = False
  780. '
  781. 'Panel8
  782. '
  783. Me.Panel8.Controls.AddRange(New System.Windows.Forms.Control() {Me.ExtraFilesList})
  784. Me.Panel8.Dock = System.Windows.Forms.DockStyle.Fill
  785. Me.Panel8.Name = "Panel8"
  786. Me.Panel8.Size = New System.Drawing.Size(403, 146)
  787. Me.Panel8.TabIndex = 2
  788. '
  789. 'ExtraFilesList
  790. '
  791. Me.ExtraFilesList.Dock = System.Windows.Forms.DockStyle.Fill
  792. Me.ExtraFilesList.Name = "ExtraFilesList"
  793. Me.ExtraFilesList.ScrollAlwaysVisible = True
  794. Me.ExtraFilesList.Size = New System.Drawing.Size(403, 134)
  795. Me.ExtraFilesList.TabIndex = 0
  796. '
  797. 'Panel9
  798. '
  799. Me.Panel9.Controls.AddRange(New System.Windows.Forms.Control() {Me.RefreshExtraFiles, Me.ExtraFilesPath, Me.SaveExtraFiles})
  800. Me.Panel9.Dock = System.Windows.Forms.DockStyle.Bottom
  801. Me.Panel9.Location = New System.Drawing.Point(0, 146)
  802. Me.Panel9.Name = "Panel9"
  803. Me.Panel9.Size = New System.Drawing.Size(403, 32)
  804. Me.Panel9.TabIndex = 1
  805. '
  806. 'SaveExtraFiles
  807. '
  808. Me.SaveExtraFiles.Location = New System.Drawing.Point(72, 8)
  809. Me.SaveExtraFiles.Name = "SaveExtraFiles"
  810. Me.SaveExtraFiles.Size = New System.Drawing.Size(56, 23)
  811. Me.SaveExtraFiles.TabIndex = 0
  812. Me.SaveExtraFiles.Text = "Save"
  813. '
  814. 'ExclusionTab
  815. '
  816. Me.ExclusionTab.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel20, Me.Panel18})
  817. Me.ExclusionTab.Location = New System.Drawing.Point(4, 40)
  818. Me.ExclusionTab.Name = "ExclusionTab"
  819. Me.ExclusionTab.Size = New System.Drawing.Size(403, 160)
  820. Me.ExclusionTab.TabIndex = 5
  821. Me.ExclusionTab.Text = "Excluded"
  822. '
  823. 'Panel18
  824. '
  825. Me.Panel18.Controls.AddRange(New System.Windows.Forms.Control() {Me.ExcludedTree})
  826. Me.Panel18.Dock = System.Windows.Forms.DockStyle.Fill
  827. Me.Panel18.Name = "Panel18"
  828. Me.Panel18.Size = New System.Drawing.Size(403, 160)
  829. Me.Panel18.TabIndex = 1
  830. '
  831. 'Panel19
  832. '
  833. Me.Panel19.Controls.AddRange(New System.Windows.Forms.Control() {Me.StatusBarGroup})
  834. Me.Panel19.Dock = System.Windows.Forms.DockStyle.Fill
  835. Me.Panel19.Name = "Panel19"
  836. Me.Panel19.Size = New System.Drawing.Size(532, 24)
  837. Me.Panel19.TabIndex = 12
  838. '
  839. 'StatusBarGroup
  840. '
  841. Me.StatusBarGroup.Dock = System.Windows.Forms.DockStyle.Fill
  842. Me.StatusBarGroup.Name = "StatusBarGroup"
  843. Me.StatusBarGroup.Panels.AddRange(New System.Windows.Forms.StatusBarPanel() {Me.LogStatus, Me.StatusBar, Me.ServerStatus})
  844. Me.StatusBarGroup.ShowPanels = True
  845. Me.StatusBarGroup.Size = New System.Drawing.Size(532, 24)
  846. Me.StatusBarGroup.TabIndex = 0
  847. Me.StatusBarGroup.Text = "StatusBar1"
  848. '
  849. 'StatusBar
  850. '
  851. Me.StatusBar.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring
  852. Me.StatusBar.BorderStyle = System.Windows.Forms.StatusBarPanelBorderStyle.None
  853. Me.StatusBar.Width = 396
  854. '
  855. 'Panel16
  856. '
  857. Me.Panel16.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel19, Me.Panel17})
  858. Me.Panel16.Dock = System.Windows.Forms.DockStyle.Bottom
  859. Me.Panel16.Location = New System.Drawing.Point(2, 276)
  860. Me.Panel16.Name = "Panel16"
  861. Me.Panel16.Size = New System.Drawing.Size(532, 24)
  862. Me.Panel16.TabIndex = 11
  863. '
  864. 'Panel17
  865. '
  866. Me.Panel17.Dock = System.Windows.Forms.DockStyle.Fill
  867. Me.Panel17.DockPadding.All = 2
  868. Me.Panel17.Name = "Panel17"
  869. Me.Panel17.Size = New System.Drawing.Size(532, 24)
  870. Me.Panel17.TabIndex = 10
  871. '
  872. 'Panel12
  873. '
  874. Me.Panel12.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel2, Me.Panel1, Me.FindProgress})
  875. Me.Panel12.Dock = System.Windows.Forms.DockStyle.Fill
  876. Me.Panel12.DockPadding.All = 2
  877. Me.Panel12.Location = New System.Drawing.Point(115, 2)
  878. Me.Panel12.Name = "Panel12"
  879. Me.Panel12.Size = New System.Drawing.Size(419, 274)
  880. Me.Panel12.TabIndex = 10
  881. '
  882. 'Panel2
  883. '
  884. Me.Panel2.Controls.AddRange(New System.Windows.Forms.Control() {Me.TreeTabs})
  885. Me.Panel2.Dock = System.Windows.Forms.DockStyle.Fill
  886. Me.Panel2.DockPadding.All = 2
  887. Me.Panel2.Location = New System.Drawing.Point(2, 48)
  888. Me.Panel2.Name = "Panel2"
  889. Me.Panel2.Size = New System.Drawing.Size(415, 208)
  890. Me.Panel2.TabIndex = 6
  891. '
  892. 'Panel1
  893. '
  894. Me.Panel1.Controls.AddRange(New System.Windows.Forms.Control() {Me.KeepAllFileLists, Me.UsePlaceholders, Me.AutoUncook, Me.CMIServerName, Me.Label1})
  895. Me.Panel1.Dock = System.Windows.Forms.DockStyle.Top
  896. Me.Panel1.Location = New System.Drawing.Point(2, 2)
  897. Me.Panel1.Name = "Panel1"
  898. Me.Panel1.Size = New System.Drawing.Size(415, 46)
  899. Me.Panel1.TabIndex = 0
  900. '
  901. 'KeepAllFileLists
  902. '
  903. Me.KeepAllFileLists.Checked = True
  904. Me.KeepAllFileLists.CheckState = System.Windows.Forms.CheckState.Checked
  905. Me.KeepAllFileLists.Location = New System.Drawing.Point(8, 24)
  906. Me.KeepAllFileLists.Name = "KeepAllFileLists"
  907. Me.KeepAllFileLists.Size = New System.Drawing.Size(176, 24)
  908. Me.KeepAllFileLists.TabIndex = 9
  909. Me.KeepAllFileLists.Text = "Keep Extra File Lists"
  910. '
  911. 'UsePlaceholders
  912. '
  913. Me.UsePlaceholders.Checked = True
  914. Me.UsePlaceholders.CheckState = System.Windows.Forms.CheckState.Checked
  915. Me.UsePlaceholders.Location = New System.Drawing.Point(200, 24)
  916. Me.UsePlaceholders.Name = "UsePlaceholders"
  917. Me.UsePlaceholders.Size = New System.Drawing.Size(216, 24)
  918. Me.UsePlaceholders.TabIndex = 8
  919. Me.UsePlaceholders.Text = "Use Dependency Placeholders"
  920. '
  921. 'AutoUncook
  922. '
  923. Me.AutoUncook.Checked = True
  924. Me.AutoUncook.CheckState = System.Windows.Forms.CheckState.Checked
  925. Me.AutoUncook.Location = New System.Drawing.Point(200, 0)
  926. Me.AutoUncook.Name = "AutoUncook"
  927. Me.AutoUncook.Size = New System.Drawing.Size(216, 24)
  928. Me.AutoUncook.TabIndex = 7
  929. Me.AutoUncook.Text = "Uncook Components Automatically"
  930. '
  931. 'CMIServerName
  932. '
  933. Me.CMIServerName.DropDownWidth = 104
  934. Me.CMIServerName.Items.AddRange(New Object() {"MAYHEM", "MELEE"})
  935. Me.CMIServerName.Location = New System.Drawing.Point(72, 0)
  936. Me.CMIServerName.Name = "CMIServerName"
  937. Me.CMIServerName.Size = New System.Drawing.Size(104, 21)
  938. Me.CMIServerName.TabIndex = 6
  939. '
  940. 'FindProgress
  941. '
  942. Me.FindProgress.Dock = System.Windows.Forms.DockStyle.Bottom
  943. Me.FindProgress.Location = New System.Drawing.Point(2, 256)
  944. Me.FindProgress.Name = "FindProgress"
  945. Me.FindProgress.Size = New System.Drawing.Size(415, 16)
  946. Me.FindProgress.TabIndex = 4
  947. '
  948. 'Panel4
  949. '
  950. Me.Panel4.Controls.AddRange(New System.Windows.Forms.Control() {Me.TabControl1})
  951. Me.Panel4.Dock = System.Windows.Forms.DockStyle.Fill
  952. Me.Panel4.DockPadding.All = 4
  953. Me.Panel4.Location = New System.Drawing.Point(3, 16)
  954. Me.Panel4.Name = "Panel4"
  955. Me.Panel4.Size = New System.Drawing.Size(104, 255)
  956. Me.Panel4.TabIndex = 3
  957. '
  958. 'TabControl1
  959. '
  960. Me.TabControl1.Controls.AddRange(New System.Windows.Forms.Control() {Me.BaseTab, Me.FullTab})
  961. Me.TabControl1.Dock = System.Windows.Forms.DockStyle.Fill
  962. Me.TabControl1.Location = New System.Drawing.Point(4, 4)
  963. Me.TabControl1.Name = "TabControl1"
  964. Me.TabControl1.SelectedIndex = 0
  965. Me.TabControl1.Size = New System.Drawing.Size(96, 247)
  966. Me.TabControl1.TabIndex = 1
  967. '
  968. 'BaseTab
  969. '
  970. Me.BaseTab.Controls.AddRange(New System.Windows.Forms.Control() {Me.FilenameList})
  971. Me.BaseTab.Location = New System.Drawing.Point(4, 22)
  972. Me.BaseTab.Name = "BaseTab"
  973. Me.BaseTab.Size = New System.Drawing.Size(88, 221)
  974. Me.BaseTab.TabIndex = 0
  975. Me.BaseTab.Text = "Base"
  976. '
  977. 'FilenameList
  978. '
  979. Me.FilenameList.Dock = System.Windows.Forms.DockStyle.Fill
  980. Me.FilenameList.Items.AddRange(New Object() {"dmboot.sys", "ksecdd.sys", "fastfat.sys", "ntfs.sys", "hal.dll", "halacpi.dll", "hal.dll", "halapic.dll", "halapic.dll", "hal.dll", "halaacpi.dll", "halaacpi.dll", "vga.sys", "cpqarray.sys", "atapi.sys", "aha154x.sys", "sparrow.sys", "symc810.sys", "aic78xx.sys", "i2omp.sys", "dac960nt.sys", "ql10wnt.sys", "amsint.sys", "asc.sys", "asc3550.sys", "mraid35x.sys", "ini910u.sys", "ql1240.sys", "tffsport.sys", "aic78u2.sys", "symc8xx.sys", "sym_hi.sys", "sym_u3.sys", "asc3350p.sys", "abp480n5.sys", "cd20xrnt.sys", "ultra.sys", "fasttrak.sys", "adpu160m.sys", "dpti2o.sys", "ql1080.sys", "ql1280.sys", "ql12160.sys", "perc2.sys", "hpn.sys", "afc9xxx.sys", "cbidf2k.sys", "dac2w2k.sys", "hpt3xx.sys", "afcnt.sys", "pci.sys", "acpi.sys", "isapnp.sys", "acpiec.sys", "ohci1394.sys", "pcmcia.sys", "pciide.sys", "intelide.sys", "viaide.sys", "cmdide.sys", "toside.sys", "aliide.sys", "mountmgr.sys", "ftdisk.sys", "partmgr.sys", "fdc.sys", "dmload.sys", "dmio.sys", "sbp2port.sys", "lbrtfdc.sys", "usbohci.sys", "usbuhci.sys", "usbhub.sys", "usbccgp.sys", "hidusb.sys", "serial.sys", "serenum.sys", "usbstor.sys", "i8042prt.sys", "kbdhid.sys", "cdrom.sys", "disk.sys", "sfloppy.sys", "ramdisk.sys", "flpydisk.sys", "fastfat.sys", "cdfs.sys", "mouclass.sys", "mouhid.sys"})
  981. Me.FilenameList.Name = "FilenameList"
  982. Me.FilenameList.ScrollAlwaysVisible = True
  983. Me.FilenameList.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended
  984. Me.FilenameList.Size = New System.Drawing.Size(88, 212)
  985. Me.FilenameList.TabIndex = 0
  986. '
  987. 'FilenamesGroup
  988. '
  989. Me.FilenamesGroup.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel4})
  990. Me.FilenamesGroup.Dock = System.Windows.Forms.DockStyle.Left
  991. Me.FilenamesGroup.FlatStyle = System.Windows.Forms.FlatStyle.Flat
  992. Me.FilenamesGroup.Location = New System.Drawing.Point(2, 2)
  993. Me.FilenamesGroup.Name = "FilenamesGroup"
  994. Me.FilenamesGroup.Size = New System.Drawing.Size(110, 274)
  995. Me.FilenamesGroup.TabIndex = 7
  996. Me.FilenamesGroup.TabStop = False
  997. Me.FilenamesGroup.Text = "Filenames"
  998. '
  999. 'Splitter1
  1000. '
  1001. Me.Splitter1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
  1002. Me.Splitter1.Location = New System.Drawing.Point(112, 2)
  1003. Me.Splitter1.Name = "Splitter1"
  1004. Me.Splitter1.Size = New System.Drawing.Size(3, 274)
  1005. Me.Splitter1.TabIndex = 9
  1006. Me.Splitter1.TabStop = False
  1007. '
  1008. 'MenuHeader
  1009. '
  1010. Me.MenuHeader.Enabled = False
  1011. Me.MenuHeader.Index = 0
  1012. Me.MenuHeader.Text = "(name)"
  1013. '
  1014. 'MenuItem4
  1015. '
  1016. Me.MenuItem4.Index = 1
  1017. Me.MenuItem4.Text = "-"
  1018. '
  1019. 'Form1
  1020. '
  1021. Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
  1022. Me.ClientSize = New System.Drawing.Size(536, 302)
  1023. Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel12, Me.Splitter1, Me.FilenamesGroup, Me.Panel16})
  1024. Me.DockPadding.All = 2
  1025. Me.Name = "Form1"
  1026. Me.Text = "File List to SLX (Uncooker)"
  1027. Me.FullTab.ResumeLayout(False)
  1028. CType(Me.LogStatus, System.ComponentModel.ISupportInitialize).EndInit()
  1029. Me.MissingFilesTab.ResumeLayout(False)
  1030. Me.Panel6.ResumeLayout(False)
  1031. Me.Panel7.ResumeLayout(False)
  1032. Me.Panel20.ResumeLayout(False)
  1033. Me.GroupTab.ResumeLayout(False)
  1034. Me.Panel10.ResumeLayout(False)
  1035. Me.InstanceTab.ResumeLayout(False)
  1036. Me.TreeTabs.ResumeLayout(False)
  1037. Me.ConfigurationTab.ResumeLayout(False)
  1038. Me.Panel5.ResumeLayout(False)
  1039. Me.Panel3.ResumeLayout(False)
  1040. Me.ByFileTab.ResumeLayout(False)
  1041. Me.Panel15.ResumeLayout(False)
  1042. Me.Panel11.ResumeLayout(False)
  1043. Me.DepTreeTab.ResumeLayout(False)
  1044. Me.Panel14.ResumeLayout(False)
  1045. Me.Panel13.ResumeLayout(False)
  1046. Me.ExtraFilesTab.ResumeLayout(False)
  1047. Me.Panel8.ResumeLayout(False)
  1048. Me.Panel9.ResumeLayout(False)
  1049. Me.ExclusionTab.ResumeLayout(False)
  1050. Me.Panel18.ResumeLayout(False)
  1051. Me.Panel19.ResumeLayout(False)
  1052. CType(Me.StatusBar, System.ComponentModel.ISupportInitialize).EndInit()
  1053. CType(Me.ServerStatus, System.ComponentModel.ISupportInitialize).EndInit()
  1054. Me.Panel16.ResumeLayout(False)
  1055. Me.Panel12.ResumeLayout(False)
  1056. Me.Panel2.ResumeLayout(False)
  1057. Me.Panel1.ResumeLayout(False)
  1058. Me.Panel4.ResumeLayout(False)
  1059. Me.TabControl1.ResumeLayout(False)
  1060. Me.BaseTab.ResumeLayout(False)
  1061. Me.FilenamesGroup.ResumeLayout(False)
  1062. Me.ResumeLayout(False)
  1063. End Sub
  1064. #End Region
  1065. #Region " VSGUIDHashcodeProvider "
  1066. ' VSGUIDHashcodeProvider is an attempt to avoid holding all the Components
  1067. ' and other CMI objects in memory all the time. Unfortunately, it seems
  1068. ' that the CMI itself is not good about releasing memory, so this only
  1069. ' solved part of the memory footprint problem.
  1070. '
  1071. ' It simply uses CMI object's VSGUID instead of the object iself when one
  1072. ' is supplied as a key. It also allows either CMI objects or String GUIDs
  1073. ' to be passed as keys without predjudice.
  1074. Private Class VSGUIDHashcodeProvider
  1075. Implements IHashCodeProvider, IComparer
  1076. Public Shared [Default] As VSGUIDHashcodeProvider = New VSGUIDHashcodeProvider()
  1077. Public Function GetHashCode(ByVal obj As Object) As Integer Implements System.Collections.IHashCodeProvider.GetHashCode
  1078. Dim VSGUID As String
  1079. If TypeOf obj Is Guid Then
  1080. Return obj
  1081. End If
  1082. If TypeOf obj Is String Then
  1083. Return obj.GetHashCode
  1084. End If
  1085. VSGUID = obj.VSGUID
  1086. Return VSGUID.GetHashCode
  1087. End Function
  1088. Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer Implements System.Collections.IComparer.Compare
  1089. Dim xVSGUID As String
  1090. Dim yVSGUID As String
  1091. If TypeOf x Is Guid Then
  1092. xVSGUID = x
  1093. ElseIf TypeOf x Is String Then
  1094. xVSGUID = x
  1095. Else
  1096. xVSGUID = x.VSGUID
  1097. End If
  1098. If TypeOf y Is Guid Then
  1099. yVSGUID = y
  1100. ElseIf TypeOf y Is String Then
  1101. yVSGUID = y
  1102. Else
  1103. yVSGUID = y.VSGUID
  1104. End If
  1105. Return Comparer.Default.Compare(xVSGUID, yVSGUID)
  1106. End Function
  1107. End Class
  1108. #End Region
  1109. #Region " Initialization Routines "
  1110. #Const NewCMI = True
  1111. Private Sub InitHashes()
  1112. Dim VHP As VSGUIDHashcodeProvider = VSGUIDHashcodeProvider.Default
  1113. Filenames = New Hashtable()
  1114. SelectedComponents = New Hashtable(VHP, VHP)
  1115. ExcludedComponents = New Hashtable(VHP, VHP)
  1116. SelectedGroups = New Hashtable(VHP, VHP)
  1117. SatisfiedGroups = New Hashtable(VHP, VHP)
  1118. XFilename2Node = New Hashtable()
  1119. XNode2Component = New Hashtable()
  1120. XComponent2FilenameList = New Hashtable(VHP, VHP)
  1121. XComponent2SelectedComponentNode = New Hashtable(VHP, VHP)
  1122. XObject2DependencyTreeNode = New Hashtable(VHP, VHP)
  1123. XObject2NodeList = New Hashtable(VHP, VHP)
  1124. XSelectedComponentNode2Component = New Hashtable()
  1125. XFilename2ComponentList = New Hashtable()
  1126. XComponent2DependerList = New Hashtable(VHP, VHP)
  1127. XGroup2GroupNode = New Hashtable()
  1128. XGroupNode2Group = New Hashtable()
  1129. ObjectNames = New Hashtable(VHP, VHP)
  1130. End Sub
  1131. Private Sub InitForm()
  1132. ' called after data init
  1133. ToolTips.SetToolTip(FilenamesGroup, "These are the files which must exist in the configuration")
  1134. MissingFilesTab.Enabled = False
  1135. ExtraFilesTab.Enabled = False
  1136. CMIServerName.Text = "MELEE"
  1137. Dim GUID As String
  1138. For Each GUID In PreExcludedList.Items
  1139. ExcludedComponents(GUID) = True
  1140. Next
  1141. UpdateFilenames()
  1142. End Sub
  1143. #End Region
  1144. #Region " VB Convenience Methods "
  1145. Public Function GetEnumName(ByRef val As [Enum]) As String
  1146. Return [Enum].GetName(val.GetType, val)
  1147. End Function
  1148. ' SS is simply a safe ToString wrapper.
  1149. Private Function SS(ByRef obj As Object) As String
  1150. Dim L As String
  1151. If obj Is Nothing Then
  1152. Return "{NULL}"
  1153. ElseIf TypeOf obj Is DBNull Then
  1154. Return "{DBNull}"
  1155. Else
  1156. Return "" & obj
  1157. End If
  1158. End Function
  1159. ' OrphanNode removes the node from view no matter what
  1160. Sub OrphanNode(ByRef Node As TreeNode)
  1161. If Node.Parent Is Nothing Then
  1162. If Not Node.TreeView Is Nothing Then
  1163. Node.TreeView.Nodes.Remove(Node)
  1164. End If
  1165. Else
  1166. Node.Remove()
  1167. End If
  1168. End Sub
  1169. ' Adds Bold to the given node's Style
  1170. Sub Bold(ByRef Node As TreeNode)
  1171. Node.NodeFont = AddStyle(Node.NodeFont, FontStyle.Bold)
  1172. End Sub
  1173. ' Adds Italic to the given node's Style
  1174. Sub Italic(ByRef Node As TreeNode)
  1175. Node.NodeFont = AddStyle(Node.NodeFont, FontStyle.Italic)
  1176. End Sub
  1177. ' Adds the given Style to the given Font
  1178. Function AddStyle(ByRef Font As Font, ByVal FontStyle As FontStyle) As Font
  1179. If Font Is Nothing Then
  1180. Font = SelectedComponentTree.Font
  1181. End If
  1182. Return New Font(Font, Font.Style + FontStyle)
  1183. End Function
  1184. ' Sets the image and selected image for a node. Only changes the image
  1185. ' if it hasn't been set already -- that is, the images are only changed
  1186. ' if they are currently the default images.
  1187. Sub ApplyImage(ByRef Node As TreeNode, ByVal Image As NodeImageIDs)
  1188. If Node.ImageIndex <= NodeImageIDs.Unknown Then
  1189. Node.ImageIndex = Image
  1190. Node.SelectedImageIndex = Image
  1191. End If
  1192. End Sub
  1193. #End Region
  1194. #Region " Log Window Support "
  1195. Dim LogWindow As ListForm = New ListForm()
  1196. Public Overloads Sub Log()
  1197. Log(StatusBar.Text)
  1198. End Sub
  1199. Public Overloads Sub Log(ByRef line As String)
  1200. LogWindow.Log(line)
  1201. End Sub
  1202. Public Overloads Sub LogErr(ByRef line As String)
  1203. LogWindow.LogErr(line)
  1204. End Sub
  1205. #End Region
  1206. #Region " Progress Bar Routines (DependencyProgress) "
  1207. Dim DependenciesToProcessCount As Integer = 0
  1208. Dim DependenciesProcessedCount As Integer = 0
  1209. Dim DependencyNodeStack As Stack = New Stack()
  1210. Sub DependencyProgress_AddCompleteTask(ByRef obj As Object, Optional ByRef ExactName As String = Nothing)
  1211. DependencyProgress_AddTasks(obj, -1, ExactName)
  1212. End Sub
  1213. Sub DependencyProgress_AddTasks(ByRef obj As Object, ByVal tasks As Integer, Optional ByRef ExactName As String = Nothing)
  1214. Dim Node As TreeNode
  1215. Dim Name As String = obj.GetType.ToString
  1216. Dim VSGUID As String
  1217. If TypeOf obj Is CMI.Component Then
  1218. Name = obj.DisplayName
  1219. VSGUID = obj.VSGUID
  1220. Node = New TreeNode(Name)
  1221. RegisterNodeForComponent(VSGUID, Node)
  1222. ElseIf TypeOf obj Is CMI.Group Then
  1223. Name = obj.DisplayName
  1224. VSGUID = obj.VSGUID
  1225. Node = New TreeNode(Name)
  1226. 'XGroupNode2Group(Node) = obj
  1227. RegisterNodeForGroup(obj, Node)
  1228. Else
  1229. Node = New TreeNode(Name)
  1230. End If
  1231. XObject2DependencyTreeNode(obj) = Node
  1232. If Not ExactName Is Nothing Then
  1233. Node.Text = ExactName
  1234. End If
  1235. If tasks = -1 Then
  1236. Node.ImageIndex = NodeImageIDs.ComponentDisabled
  1237. Node.SelectedImageIndex = NodeImageIDs.ComponentDisabled
  1238. Italic(Node)
  1239. Node.ForeColor = Color.Gray
  1240. Else
  1241. DependenciesToProcessCount = DependenciesToProcessCount + tasks
  1242. DependencyProgress_Update()
  1243. End If
  1244. If DependencyNodeStack.Count = 0 Then
  1245. DependencyTree.Nodes.Add(Node)
  1246. Else
  1247. DependencyNodeStack.Peek.Nodes.Add(Node)
  1248. If ExpandNewNodes.Checked Then
  1249. DependencyNodeStack.Peek.Expand()
  1250. End If
  1251. End If
  1252. While tasks > 0
  1253. DependencyNodeStack.Push(Node)
  1254. tasks = tasks - 1
  1255. End While
  1256. End Sub
  1257. Sub DependencyProgress_AddTask(ByRef obj As Object)
  1258. DependencyProgress_AddTasks(obj, 1)
  1259. End Sub
  1260. Sub DependencyProgress_CompleteTasks(ByVal tasks As Integer)
  1261. DependenciesProcessedCount = DependenciesProcessedCount + 1
  1262. DependenciesToProcessCount = DependenciesToProcessCount - 1
  1263. DependencyProgress_Update()
  1264. While tasks > 0
  1265. Dim Node As TreeNode
  1266. Node = DependencyNodeStack.Pop()
  1267. tasks = tasks - 1
  1268. End While
  1269. End Sub
  1270. Sub DependencyProgress_CompleteTask()
  1271. DependencyProgress_CompleteTasks(1)
  1272. End Sub
  1273. Sub DependencyProgress_Update()
  1274. FindProgress.Minimum = 0
  1275. FindProgress.Maximum = DependenciesProcessedCount + DependenciesToProcessCount
  1276. FindProgress.Value = DependenciesProcessedCount
  1277. If DependenciesToProcessCount = 0 Then
  1278. FindProgress.Value = 0
  1279. FindProgress.Maximum = 0
  1280. End If
  1281. End Sub
  1282. #End Region
  1283. #Region " CMI Interaction "
  1284. #Region " Event handlers for CMI "
  1285. '////////////////////////////////////////////////////////////////////////////
  1286. ' cmi_OnWriteMsg
  1287. ' CMI OnWriteMsg handler
  1288. '
  1289. ' nType Message type
  1290. ' sText Message text
  1291. Private Sub CMI_OnWriteMsg(ByVal MsgType As CMI.MsgTypeConsts, ByVal [Text] As String) Handles CMI.OnWriteMsg
  1292. Log("CMI!WriteMsg(" & GetEnumName(MsgType) & "): " & [Text])
  1293. End Sub
  1294. '////////////////////////////////////////////////////////////////////////////
  1295. ' cmi_OnReportStatus
  1296. ' CMI OnReportStatus handler
  1297. '
  1298. ' nType Status type
  1299. ' nContent Status content code
  1300. ' vData Status data
  1301. ' Returns 0 to continue, <>0 stops with error code
  1302. Private Function CMI_OnReportStatus(ByVal StatusType As Integer, ByVal Context As Integer, ByVal Data As Object, ByRef pvarRet As Object) As Integer Handles CMI.OnReportStatus
  1303. Log("CMI!ReportStatus(" & StatusType & "," & Context & "): " & CStr(Data))
  1304. CMI_OnReportStatus = 0 ' 0 means continue
  1305. End Function
  1306. #End Region
  1307. ' TypeOf allows the type of a CMI object or GUID to be determined. All
  1308. ' CMI objects show up as generic COMObjects (if one uses the Object.Type
  1309. ' method), so I've encapulated the steps required to determine the actual
  1310. ' type of a CMI object or GUID here.
  1311. Public Function [TypeOf](ByRef __obj As Object) As CMIObjectTypes
  1312. If TypeOf __obj Is CMI.IComponent Then
  1313. Return CMIObjectTypes.Component
  1314. ElseIf TypeOf __obj Is CMI.IGroup Then
  1315. Return CMIObjectTypes.Group
  1316. ElseIf XGroup2GroupNode.Contains(__obj) Then
  1317. Return CMIObjectTypes.Group
  1318. ElseIf XObject2NodeList.Contains(__obj) Then
  1319. ' This is based on the assumption that XObject2NodeList has only
  1320. ' Groups and Components as keys.
  1321. Return CMIObjectTypes.Component
  1322. ElseIf TypeOf __obj Is String Then
  1323. Return [TypeOf](CMI.CreateFromDB(ObjectTypeConsts.cmiUnknown, GetPlatform.VSGUID, FilterTypeConsts.cmiFTGetByObjGUID, __obj))
  1324. Else
  1325. Return CMIObjectTypes.Unknown
  1326. End If
  1327. End Function
  1328. ' Initializes our CMI object
  1329. Private Sub EnsureCMI()
  1330. If CMI Is Nothing Then
  1331. CMI = New CMI.CMI()
  1332. CMI.DebugScript = True
  1333. CMI.LogMessages = True
  1334. CMI.LogFile = "fl2slx.log"
  1335. CMI.OpenDB(CMIServerName.Text, DBModeConsts.cmiDBReadOnly)
  1336. End If
  1337. End Sub
  1338. ' GetComponentName returns the cached name or generates the string that
  1339. ' will appear in the GUI to represent the specified component.
  1340. Public Overloads Function GetComponentName(ByVal VSGUID As String) As String
  1341. If ObjectNames.Contains(VSGUID) Then
  1342. Return ObjectNames(VSGUID)
  1343. Else
  1344. Return GetComponentName(GetComponent(VSGUID))
  1345. End If
  1346. End Function
  1347. Public Overloads Function GetComponentName(ByVal Component As CMI.Component) As String
  1348. If ObjectNames.Contains(Component) Then
  1349. Return ObjectNames(Component)
  1350. End If
  1351. Dim DisplayName = Component.DisplayName
  1352. Dim Version = Component.Version
  1353. Dim Revision = Component.Revision
  1354. If TypeOf DisplayName Is System.DBNull Then
  1355. DisplayName = "(DisplayName is NULL)"
  1356. End If
  1357. If TypeOf Version Is System.DBNull Then
  1358. Version = "(Version is NULL)"
  1359. End If
  1360. If TypeOf Revision Is System.DBNull Then
  1361. Revision = "(Revision is NULL)"
  1362. End If
  1363. Return DisplayName & " [" & Version & ", R" & Revision & "]"
  1364. End Function
  1365. ' GetGroupsFromDB retrieves all the groups from the repository, populating
  1366. ' the Group tab's tree in the process.
  1367. Private Sub GetGroupsFromDB()
  1368. Dim Groups As CMI.Groups
  1369. Dim Group As CMI.Group
  1370. Dim GroupNode As TreeNode
  1371. EnsureCMI()
  1372. Groups = CMI.CreateFromDB(ObjectTypeConsts.cmiGroups, GetPlatform.VSGUID, FilterTypeConsts.cmiFTGetAll)
  1373. For Each Group In Groups
  1374. SelectedGroups(Group) = False
  1375. GroupNode = GroupList.Nodes.Add(Group.DisplayName)
  1376. ' we add this placeholder to make the [+] show up for each group.
  1377. ' it will be replaced by the actual group's contents when the
  1378. ' user expands the group node.
  1379. GroupNode.Nodes.Add("")
  1380. XGroup2GroupNode(Group) = GroupNode
  1381. RegisterNodeForGroup(Group, GroupNode)
  1382. Next
  1383. End Sub
  1384. #Region " Old/New CMI Compatibility Functions "
  1385. ' I've left in the old CMI code so you can get a feel for what changed
  1386. ' from the old CMI to the new CMI. Mostly, you can see how much more
  1387. ' awkward and less-than-object-oriented it seems to have become. :-P
  1388. Dim Platforms As CMI.Platforms
  1389. Dim Platform As CMI.Platform
  1390. Dim AllPlatformComponents As CMI.components
  1391. Private Function GetPlatforms() As CMI.Platforms
  1392. If Platforms Is Nothing Then
  1393. #If NewCMI Then
  1394. Platforms = CMI.CreateFromDB(ObjectTypeConsts.cmiPlatforms, vbNullString, FilterTypeConsts.cmiFTGetAll)
  1395. #Else
  1396. Platforms = CMI.GetPlatforms
  1397. #End If
  1398. End If
  1399. Return Platforms
  1400. End Function
  1401. Private Function GetPlatform(Optional ByVal Index As Integer = 1) As CMI.Platform
  1402. If Platform Is Nothing Then
  1403. Platform = GetPlatforms()(Index)
  1404. End If
  1405. Return Platform
  1406. End Function
  1407. Private Function GetComponents() As CMI.components
  1408. If AllPlatformComponents Is Nothing Then
  1409. #If NewCMI Then
  1410. AllPlatformComponents = CMI.CreateFromDB(ObjectTypeConsts.cmiComponents, GetPlatform().VSGUID, FilterTypeConsts.cmiFTGetAll)
  1411. #Else
  1412. AllPlatformComponents = GetPlatform().GetComponents
  1413. #End If
  1414. End If
  1415. Return AllPlatformComponents
  1416. End Function
  1417. Private Function GetResources(ByRef Component As CMI.Component) As CMI.Resources
  1418. #If NewCMI Then
  1419. Return Component.Resources
  1420. #Else
  1421. Return Component.GetResources
  1422. #End If
  1423. End Function
  1424. Private Function IsFileResource(ByRef Resource As CMI.Resource) As Boolean
  1425. #If NewCMI Then
  1426. Return Resource.ResourceTypeVSGUID = RESTYPE_FILE
  1427. #Else
  1428. Return Resource.Type.VSGUID = RESTYPE_FILE
  1429. #End If
  1430. End Function
  1431. Private Function NewConfiguration() As CMI.Configuration
  1432. #If NewCMI Then
  1433. Return CMI.CreateObject(ObjectTypeConsts.cmiConfiguration, GetPlatform().VSGUID)
  1434. #Else
  1435. Return GetPlatform().NewConfiguration()
  1436. #End If
  1437. End Function
  1438. Private Sub SaveConfigurationToFile(ByRef Configuration As CMI.Configuration, ByVal FileName As String)
  1439. #If NewCMI Then
  1440. CMI.SaveToFile(Configuration, FileName)
  1441. #Else
  1442. Configuration.Path = FileName
  1443. Configuration.Save()
  1444. #End If
  1445. End Sub
  1446. Private Function LoadConfigurationFromFile(ByVal FileName As String) As CMI.Configuration
  1447. #If NewCMI Then
  1448. Return CMI.CreateFromFile(FileName)
  1449. #Else
  1450. Return GetPlatform().OpenConfiguration(FileName)
  1451. #End If
  1452. End Function
  1453. #End Region
  1454. Public Function GetComponent(ByRef ComponentOrVSGUID As Object) As CMI.Component
  1455. If TypeOf ComponentOrVSGUID Is System.DBNull Then
  1456. Return Nothing
  1457. ElseIf TypeOf ComponentOrVSGUID Is CMI.IComponent Then
  1458. Return ComponentOrVSGUID
  1459. Else
  1460. Return CMI.CreateFromDB(ObjectTypeConsts.cmiComponent, GetPlatform.VSGUID, FilterTypeConsts.cmiFTGetByObjGUID, ComponentOrVSGUID)
  1461. End If
  1462. End Function
  1463. #Region " Uncooking "
  1464. ' "Uncooking" a component refers to the process of identifying which files
  1465. ' are provided by that component. I used the term "uncooking" since the
  1466. ' Mantis team uses "cooking" to describe what is kind of the reverse process --
  1467. ' taking the raw file dependencies (from dll import sections) and turning that
  1468. ' into a component definition.
  1469. ' The UncookComponent method iterates through a component's resources,
  1470. ' and for each one that is a file resource adds the component to that
  1471. ' file's component list. It also populates the File tab's tree with a
  1472. ' component node as a child of that file's node.
  1473. Public Overloads Sub UncookComponent(ByRef ComponentVSGUID As String)
  1474. UncookComponent(GetComponent(ComponentVSGUID))
  1475. End Sub
  1476. Public Overloads Sub UncookComponent(ByRef Component As CMI.Component)
  1477. If IsComponentUncooked(Component) Then
  1478. Return
  1479. End If
  1480. Dim Resources As CMI.Resources
  1481. Dim Resource As CMI.Resource
  1482. Dim Properties As CMI.ExtProperties
  1483. Dim Prop As CMI.ExtProperty
  1484. Dim Filename As String
  1485. Dim ComponentFilenames As ArrayList = New ArrayList()
  1486. Application.DoEvents()
  1487. Resources = GetResources(Component)
  1488. ' to save some memory, we provide the option to discard the
  1489. ' file lists of components which don't provide any of the files
  1490. ' in the GUI's filenames list.
  1491. Dim KeepFileList As Boolean = KeepAllFileLists.Checked
  1492. For Each Resource In Resources
  1493. If IsFileResource(Resource) Then
  1494. Properties = Resource.Properties
  1495. Prop = Properties.Item("DstName")
  1496. If Not Prop Is Nothing Then
  1497. Filename = Prop.Value
  1498. Dim FilenameComponents As ArrayList
  1499. ComponentFilenames.Add(Filename)
  1500. If Filenames.ContainsKey(Filename) Then
  1501. ' the component provides a file the user is interested in
  1502. ' so we will always keep this file list.
  1503. KeepFileList = True
  1504. FilenameComponents = GetComponentListForFilename(Filename)
  1505. FilenameComponents.Add(Component.VSGUID)
  1506. ' update the tree by adding a node for the component
  1507. Dim FileNode As TreeNode = XFilename2Node(Filename)
  1508. Dim ComponentNode As TreeNode = FileNode.Nodes.Add(GetComponentName(Component))
  1509. Dim ComponentVSGUID As String = Component.VSGUID
  1510. RegisterNodeForComponent(ComponentVSGUID, ComponentNode)
  1511. If SelectedComponents(Component) Then
  1512. ComponentNode.Checked = True
  1513. End If
  1514. End If
  1515. End If
  1516. End If
  1517. Next Resource
  1518. If KeepFileList Then
  1519. XComponent2FilenameList.Add(Component.VSGUID, ComponentFilenames)
  1520. End If
  1521. End Sub
  1522. ' Retrieves every component from the repository and uncooks it using
  1523. ' UncookComponent.
  1524. Sub UncookAllComponents()
  1525. Dim Components As CMI.Components
  1526. Dim Component As CMI.Component
  1527. EnsureCMI()
  1528. UpdateFilenames()
  1529. Components = GetComponents()
  1530. FindProgress.Minimum = 0
  1531. FindProgress.Maximum = Components.Count()
  1532. FindProgress.Value = 0
  1533. For Each Component In Components
  1534. FindProgress.Value = FindProgress.Value + 1
  1535. UncookComponent(Component)
  1536. Next Component
  1537. End Sub
  1538. #End Region ' Uncook
  1539. ' CreateConfiguration initializes and populates a new Configuration
  1540. ' based on which components have been selected.
  1541. Private Function CreateConfiguration() As CMI.Configuration
  1542. Dim Configuration As CMI.Configuration
  1543. Dim ComponentVSGUID As String
  1544. Dim Component As CMI.Component
  1545. StatusBar.Text = "Creating configuration ..."
  1546. Configuration = NewConfiguration()
  1547. Configuration.Activate()
  1548. InstanceTree.Nodes.Clear()
  1549. FindProgress.Minimum = 0
  1550. FindProgress.Maximum = SelectedComponents.Count
  1551. FindProgress.Value = 0
  1552. For Each ComponentVSGUID In SelectedComponents.Keys
  1553. Dim Instance As CMI.Instance = CMI.CreateFromDB(ObjectTypeConsts.cmiInstance, Platform.VSGUID, FilterTypeConsts.cmiFTGetByObjGUID, ComponentVSGUID)
  1554. Log("Instantiated: " + Instance.DisplayName)
  1555. Configuration.Instances.Add(Instance)
  1556. FindProgress.Value = FindProgress.Value + 1
  1557. Next
  1558. FindProgress.Value = 0
  1559. StatusBar.Text = "Configuration complete."
  1560. Return Configuration
  1561. End Function
  1562. #End Region
  1563. #Region " In-Memory Data Maintenance "
  1564. Function IsComponent(ByRef Node As TreeNode) As Boolean
  1565. Return IsComponent(Node.Tag)
  1566. End Function
  1567. Function IsComponent(ByRef VSGUID As String) As Boolean
  1568. Return [TypeOf](VSGUID) = CMIObjectTypes.Component
  1569. End Function
  1570. Public Overloads Function IsComponentSelected(ByRef Component As CMI.Component) As Boolean
  1571. Return IsComponentSelected(Component.VSGUID)
  1572. End Function
  1573. Public Overloads Function IsComponentSelected(ByRef VSGUID As String) As Boolean
  1574. If SelectedComponents.Contains(VSGUID) Then
  1575. Return SelectedComponents(VSGUID)
  1576. Else
  1577. Return False
  1578. End If
  1579. End Function
  1580. Public Overloads Function IsComponentExcluded(ByRef Component As CMI.Component) As Boolean
  1581. If ExcludedComponents.Contains(Component.VSGUID) Then
  1582. Return ExcludedComponents(Component.VSGUID)
  1583. ElseIf ExcludedComponents.Contains(Component.VIGUID) Then
  1584. Return ExcludedComponents(Component.VIGUID)
  1585. Else
  1586. Return False
  1587. End If
  1588. End Function
  1589. Public Overloads Function IsComponentExcluded(ByRef VSGUID As String) As Boolean
  1590. Return IsComponentExcluded(GetComponent(VSGUID))
  1591. End Function
  1592. Public Overloads Function IsComponentUncooked(ByRef Component As CMI.Component) As Boolean
  1593. Return XComponent2FilenameList.Contains(Component.VSGUID)
  1594. End Function
  1595. Public Overloads Function IsComponentUncooked(ByRef VSGUID As String) As Boolean
  1596. Return XComponent2FilenameList.Contains(VSGUID)
  1597. End Function
  1598. ' Retrieve or create a new list of components which provide the given file.
  1599. Private Function GetComponentListForFilename(ByRef Filename As String)
  1600. Dim FilenameComponents As ArrayList = XFilename2ComponentList(Filename)
  1601. If FilenameComponents Is Nothing Then
  1602. FilenameComponents = New ArrayList()
  1603. XFilename2ComponentList.Add(Filename, FilenameComponents)
  1604. End If
  1605. Return FilenameComponents
  1606. End Function
  1607. Public Function GetDependerList(ByRef ComponentVSGUID) As ArrayList
  1608. Dim DependerList As ArrayList
  1609. DependerList = XComponent2DependerList(ComponentVSGUID)
  1610. If DependerList Is Nothing Then
  1611. DependerList = New ArrayList()
  1612. XComponent2DependerList(ComponentVSGUID) = DependerList
  1613. End If
  1614. Return DependerList
  1615. End Function
  1616. #End Region
  1617. #Region " GUI Data Maintenance "
  1618. Sub RegisterNodeForObject(ByRef obj As Object, ByRef Node As TreeNode)
  1619. Dim NodeList As ArrayList = XObject2NodeList(obj)
  1620. If NodeList Is Nothing Then
  1621. NodeList = New ArrayList()
  1622. XObject2NodeList(obj) = NodeList
  1623. End If
  1624. NodeList.Add(Node)
  1625. If Node.Tag Is Nothing Then
  1626. Node.Tag = obj
  1627. End If
  1628. End Sub
  1629. Private Sub RegisterNodeForComponent(ByRef ComponentVSGUID As String, ByRef ComponentNode As TreeNode)
  1630. If SelectedComponents(ComponentVSGUID) Is Nothing Then
  1631. SelectedComponents(ComponentVSGUID) = False
  1632. End If
  1633. If Not (SelectedComponents(ComponentVSGUID) = ComponentNode.Checked) Then
  1634. ComponentNode.Checked = SelectedComponents(ComponentVSGUID)
  1635. End If
  1636. ' I should really just get rid of XSelectedComponentNode2Component --
  1637. ' XNode2Component should be sufficient.
  1638. If SelectedComponents(ComponentVSGUID) Then
  1639. If Not XSelectedComponentNode2Component.Contains(ComponentNode) Then
  1640. XSelectedComponentNode2Component(ComponentNode) = ComponentVSGUID
  1641. End If
  1642. Else
  1643. If XSelectedComponentNode2Component.Contains(ComponentNode) Then
  1644. XSelectedComponentNode2Component.Remove(ComponentNode)
  1645. End If
  1646. End If
  1647. XNode2Component(ComponentNode) = ComponentVSGUID
  1648. RegisterNodeForObject(ComponentVSGUID, ComponentNode)
  1649. ComponentNode.Tag = ComponentVSGUID
  1650. ApplyImage(ComponentNode, NodeImageIDs.Component)
  1651. End Sub
  1652. Sub RegisterNodeForGroup(ByRef Group As Group, ByRef GroupNode As TreeNode)
  1653. XGroupNode2Group(GroupNode) = Group
  1654. RegisterNodeForObject(Group, GroupNode)
  1655. GroupNode.Tag = Group.VSGUID
  1656. ApplyImage(GroupNode, NodeImageIDs.Group)
  1657. End Sub
  1658. ' Retrieve or generate a new node for use in the
  1659. ' selected node tree (configuration tab).
  1660. ' TODO: These nodes are populated with children somewhere else
  1661. Private Function GetSelectedComponentNode(ByRef Component As CMI.Component) As TreeNode
  1662. Dim ComponentNode As TreeNode
  1663. Dim ComponentVSGUID As String = Component.VSGUID
  1664. ComponentNode = XComponent2SelectedComponentNode(Component)
  1665. If ComponentNode Is Nothing Then
  1666. ComponentNode = New TreeNode(GetComponentName(Component))
  1667. XComponent2SelectedComponentNode(ComponentVSGUID) = ComponentNode
  1668. XSelectedComponentNode2Component(ComponentNode) = ComponentVSGUID
  1669. RegisterNodeForComponent(ComponentVSGUID, ComponentNode)
  1670. SelectedComponentTree.Nodes.Add(ComponentNode)
  1671. ComponentNode.Nodes.Add("")
  1672. End If
  1673. Return ComponentNode
  1674. End Function
  1675. ' UpdateFilenames populates the filename tree with nodes for each filename
  1676. ' the user has indicated interest in. It supports adding and removing files
  1677. ' even though the GUI doesn't really allow that yet.
  1678. '
  1679. ' Note that it _does not_ populate the file nodes with component nodes ala
  1680. ' UncookComponent. That among other reasons is why you can only change the
  1681. ' list of files by editing the GUI in VS.
  1682. Private Sub UpdateFilenames()
  1683. Dim Filename
  1684. Dim FileNode As TreeNode
  1685. 'FilenameTree.BeginUpdate()
  1686. If Filenames Is Nothing Then
  1687. Filenames = New Hashtable()
  1688. End If
  1689. Filenames.Clear()
  1690. ' add nodes for new files in the list
  1691. For Each Filename In FilenameList.Items
  1692. Filenames(Filename) = True
  1693. If XFilename2Node(Filename) Is Nothing Then
  1694. FileNode = FilenameTree.Nodes.Add(Filename)
  1695. FileNode.ImageIndex = NodeImageIDs.File
  1696. FileNode.SelectedImageIndex = NodeImageIDs.File
  1697. XFilename2Node.Add(Filename, FileNode)
  1698. End If
  1699. Next
  1700. ' remove nodes for files no longer in the list
  1701. Dim Marked As ArrayList : Marked = New ArrayList()
  1702. For Each Filename In XFilename2Node.Keys
  1703. If Not Filenames.ContainsKey(Filename) Then
  1704. Marked.Add(Filename)
  1705. FilenameTree.Nodes.Remove(XFilename2Node(Filename))
  1706. End If
  1707. Next
  1708. For Each Filename In Marked
  1709. XFilename2Node.Remove(Filename)
  1710. Next
  1711. 'FilenameTree.EndUpdate()
  1712. End Sub
  1713. ' UpdateGroupsList makes sure the checked state of the group nodes
  1714. ' matches the information in SelectedGroups.
  1715. '
  1716. ' IN_UpdateGroupsList is used to halt the recursive nature of the
  1717. ' Node class' Checked property. That is, it allows this method to be
  1718. ' called safely from a group node's event handlers.
  1719. Dim IN_UpdateGroupsList = False
  1720. Private Sub UpdateGroupsList()
  1721. Dim Group As CMI.Group
  1722. If IN_UpdateGroupsList Then
  1723. Return
  1724. End If
  1725. IN_UpdateGroupsList = True
  1726. For Each Group In SelectedGroups.Keys
  1727. If Not SelectedGroups(Group) Is XGroup2GroupNode(Group).Checked Then
  1728. XGroup2GroupNode(Group).Checked = SelectedGroups(Group)
  1729. End If
  1730. Next
  1731. IN_UpdateGroupsList = False
  1732. End Sub
  1733. ' UpdateCheckedFiles makes sure the appearance of the filename tree is in sync
  1734. Private Sub UpdateCheckedFiles()
  1735. Dim Component
  1736. Dim FileNode As TreeNode
  1737. Dim ComponentNode As TreeNode
  1738. Dim Filename As String
  1739. For Each FileNode In FilenameTree.Nodes
  1740. FileNode.Checked = False
  1741. Next
  1742. For Each Component In SelectedComponents.Keys
  1743. If Not XComponent2FilenameList(Component) Is Nothing Then
  1744. For Each Filename In XComponent2FilenameList(Component)
  1745. FileNode = XFilename2Node(Filename)
  1746. If Not FileNode Is Nothing Then
  1747. FileNode.Checked = True
  1748. End If
  1749. Next
  1750. End If
  1751. If Not XObject2NodeList(Component) Is Nothing Then
  1752. For Each ComponentNode In XObject2NodeList(Component)
  1753. ComponentNode.Checked = True
  1754. Next
  1755. End If
  1756. Next Component ' In SelectedComponents.Keys
  1757. End Sub
  1758. ' UpdateSelectedComponents makes sure the state of the configuration tab
  1759. ' matches the information in SelectedGroups.
  1760. '
  1761. ' IN_UpdateSelectedComponents is used to halt the recursive nature of the
  1762. ' Node class' Checked property. That is, it allows this method to be
  1763. ' called safely from a component node's event handlers.
  1764. Dim IN_UpdateSelectedComponents As Boolean = False
  1765. Private Sub UpdateSelectedComponents()
  1766. Dim Component As CMI.Component
  1767. Dim ComponentVSGUID As String
  1768. Dim ComponentNode As TreeNode
  1769. Dim Filename As String
  1770. Dim FileNode As TreeNode
  1771. If IN_UpdateSelectedComponents Then
  1772. Return
  1773. End If
  1774. IN_UpdateSelectedComponents = True
  1775. For Each ComponentNode In SelectedComponentTree.Nodes
  1776. ComponentVSGUID = XSelectedComponentNode2Component(ComponentNode)
  1777. If Not SelectedComponents.Contains(ComponentVSGUID) Then
  1778. SelectedComponents(ComponentVSGUID) = False
  1779. End If
  1780. Next ComponentNode
  1781. Dim MarkedForDestruction As ArrayList = New ArrayList()
  1782. ' add nodes for newly selected components
  1783. For Each ComponentVSGUID In SelectedComponents.Keys
  1784. If SelectedComponents(ComponentVSGUID) Then
  1785. If Not XComponent2SelectedComponentNode.Contains(ComponentVSGUID) Then
  1786. ' add component to list -- remember that
  1787. ' GetSelectedComponentNode creates the node if necessary
  1788. GetSelectedComponentNode(GetComponent(ComponentVSGUID))
  1789. End If
  1790. Else
  1791. If XComponent2SelectedComponentNode.Contains(ComponentVSGUID) Then
  1792. ' remove component from list
  1793. MarkedForDestruction.Add(ComponentVSGUID)
  1794. End If
  1795. End If
  1796. Next ComponentVSGUID
  1797. For Each ComponentVSGUID In MarkedForDestruction
  1798. ' we set its entry in SelectedComponents to true to force
  1799. ' SetComponentSelected to remove all of its nodes -- if we've
  1800. ' gotten to this point we're cleaning up after something left the
  1801. ' GUI out of sync.
  1802. SelectedComponents(ComponentVSGUID) = True
  1803. SetComponentSelected(ComponentVSGUID, False)
  1804. Next ComponentVSGUID
  1805. IN_UpdateSelectedComponents = False
  1806. End Sub
  1807. ' Makes sure the options in the context menu are enabled or disabled
  1808. ' appropriately. Invoked every time the context menu is about to be shown
  1809. ' by SelectedComponentsContextMenu_Popup()
  1810. Private Sub FixSelectedComponentContextMenu(ByRef Tree As TreeView)
  1811. Dim ComponentNode As TreeNode
  1812. MenuHeader.Text = "(no component selected)"
  1813. ShowComponentPropertiesCmd.Enabled = False
  1814. RemoveComponentCmd.Enabled = False
  1815. ExcludeCmd.Enabled = False
  1816. RefreshSelectedComponentsCmd.Enabled = False
  1817. ComponentNode = Tree.SelectedNode()
  1818. ' we only enable the component commands (props, remove, exclude) if
  1819. ' the selected node is actually a component. We have a header menu
  1820. ' item because it is often unclear what node is actually selected
  1821. ' in VB's Tree control.
  1822. If (Not ComponentNode Is Nothing) Then
  1823. Dim VSGUID As String = ComponentNode.Tag
  1824. If IsComponent(VSGUID) Then
  1825. MenuHeader.Text = ComponentNode.Text
  1826. ShowComponentPropertiesCmd.Enabled = True
  1827. ExcludeCmd.Enabled = True
  1828. If IsComponentSelected(VSGUID) Then
  1829. RemoveComponentCmd.Enabled = True
  1830. End If
  1831. End If
  1832. End If
  1833. End Sub
  1834. ' RefreshDependencies is intended as a (slow) sanity check to make sure the GUI
  1835. ' is accurately reflecting all the group and component selections that have been
  1836. ' made so far. It hasn't been tested much.
  1837. Private Sub RefreshDependencies()
  1838. Dim ComponentRoots As ArrayList = New ArrayList()
  1839. Dim GroupRoots As ArrayList = New ArrayList()
  1840. Dim Node As TreeNode
  1841. Dim Group As CMI.Group
  1842. For Each Node In DependencyTree.Nodes
  1843. If XNode2Component.Contains(Node) Then
  1844. ComponentRoots.Add(XNode2Component(Node))
  1845. ElseIf XGroupNode2Group.Contains(Node) Then
  1846. GroupRoots.Add(XGroupNode2Group(Node))
  1847. End If
  1848. Next
  1849. Dim VSGUID As String
  1850. For Each VSGUID In ComponentRoots
  1851. SetComponentSelected(VSGUID, False)
  1852. Next
  1853. For Each Group In GroupRoots
  1854. SetGroupSelected(Group, False)
  1855. Next
  1856. SatisfiedGroups.Clear()
  1857. For Each Group In GroupRoots
  1858. SetGroupSelected(Group, True)
  1859. Next
  1860. For Each VSGUID In ComponentRoots
  1861. SetComponentSelected(VSGUID, True)
  1862. Next
  1863. End Sub
  1864. #End Region
  1865. #Region " SetSelected/Excluded/Satisfied Subroutines "
  1866. ' SetObjectSelected is simply a wrapper for the other SetSelected methods
  1867. ' allowing a single entry point. Used by the context menu commands.
  1868. Public Sub SetObjectSelected(ByRef __obj As Object, ByVal Selected As Boolean, Optional ByVal DependencyMode As DependencyModes = DependencyModes.IgnoreAll, Optional ByVal CreateDependencyTreePlaceholders As Boolean = False)
  1869. Select Case [TypeOf](__obj)
  1870. Case CMIObjectTypes.Component
  1871. SetComponentSelected(__obj, Selected, DependencyMode, CreateDependencyTreePlaceholders)
  1872. Case CMIObjectTypes.Group
  1873. SetGroupSelected(__obj, Selected, DependencyMode, CreateDependencyTreePlaceholders)
  1874. End Select
  1875. End Sub
  1876. #Region " SetComponentSelected/Excluded "
  1877. Public Overloads Sub SetComponentSelected(ByRef __obj As Object, ByVal [Select] As Boolean, Optional ByVal DependencyMode As DependencyModes = DependencyModes.IgnoreAll, Optional ByVal CreateDependencyTreePlaceholders As Boolean = False)
  1878. ' we only need the real component to get its display name. oh well...
  1879. Dim Component As CMI.Component = GetComponent(__obj)
  1880. Dim ComponentNode As TreeNode
  1881. ' If the user wants components to be uncooked during the selection
  1882. ' process, we go ahead and do that here. Doing this allows us to
  1883. ' keep the File tab in sync with the configuration at all times at the
  1884. ' cost of some time and memory.
  1885. If AutoUncook.Checked And Not IsComponentUncooked(Component) Then
  1886. UncookComponent(Component)
  1887. End If
  1888. ' unimplemented, of course :-P
  1889. 'Dim Type = CMI.QueryGUIDType(GetPlatform.VSGUID, Component.VSGUID)
  1890. If SelectedComponents(Component) Then
  1891. If [Select] Then
  1892. ' If the user wants placeholders inserted in the dependency
  1893. ' graph, we create them. Otherwise we have nothing to do
  1894. ' since the component is already selected.
  1895. If CreateDependencyTreePlaceholders Then
  1896. DependencyProgress_AddCompleteTask(Component, Component.DisplayName)
  1897. End If
  1898. Return
  1899. Else
  1900. ' We need to deselect the component. This involves the
  1901. ' following steps:
  1902. '
  1903. ' 1) determine whether the component should _not_ be
  1904. ' deselected due to known dependencies,
  1905. ' 2) uncheck or remove (as appropriate) all tree nodes in
  1906. ' the GUI which represent the component,
  1907. ' 3) propogate, given the dependency mode, the deselection
  1908. ' to components and groups selected because of this
  1909. ' component -- that is, its children in the dependency
  1910. ' graph.
  1911. If Not HasDepender(Component.VSGUID, DependencyMode) Then
  1912. StatusBar.Text = "Deselecting: " & Component.DisplayName
  1913. Log()
  1914. SelectedComponents(Component.VSGUID) = False
  1915. If DependencyMode = DependencyModes.IgnoreOne Then
  1916. DependencyMode = DependencyModes.IgnoreNone
  1917. End If
  1918. For Each ComponentNode In XObject2NodeList(Component)
  1919. If ComponentNode.Checked Then
  1920. ' We don't have to worry about recursion in this
  1921. ' case because the fist thing we do in this
  1922. ComponentNode.Checked = False
  1923. End If
  1924. ' we need to propogate the deselection for the dependency tree
  1925. Dim ChildNode As TreeNode
  1926. For Each ChildNode In ComponentNode.Nodes
  1927. If ChildNode.ImageIndex = NodeImageIDs.ComponentDisabled Then
  1928. ' This is a placeholder node, and it can be
  1929. ' removed with impunity.
  1930. KillChildNode: OrphanNode(ChildNode)
  1931. If XNode2Component.Contains(ChildNode) Then
  1932. XNode2Component.Remove(ChildNode)
  1933. End If
  1934. If XGroupNode2Group.Contains(ChildNode) Then
  1935. XGroupNode2Group.Remove(ChildNode)
  1936. End If
  1937. ' this was only a placeholder node, so we skip
  1938. ' the rest of the child node deselection code
  1939. Goto NextChildNode
  1940. End If
  1941. Dim ChildVSGUID As String = ChildNode.Tag
  1942. If Not ChildVSGUID Is Nothing Then
  1943. If XNode2Component.Contains(ChildNode) Then
  1944. ChildVSGUID = XNode2Component(ChildNode)
  1945. ElseIf XGroupNode2Group.Contains(ChildNode) Then
  1946. ChildVSGUID = XGroupNode2Group(ChildNode).VSGUID
  1947. End If
  1948. End If
  1949. If ChildVSGUID Is Nothing Then
  1950. LogErr("Error processing child node for deletion: " & ChildNode.Text)
  1951. Goto KillChildNode
  1952. Else
  1953. If DependencyMode = DependencyModes.IgnoreNone Then
  1954. ' We move this child and its subtree to the next
  1955. ' component which depends on it, if such a component
  1956. ' exists. Otherwise, the component it represents is
  1957. ' deselected (and the node removed).
  1958. Dim DependerList As ArrayList
  1959. DependerList = GetDependerList(ChildVSGUID)
  1960. If DependerList.Count = 0 Then
  1961. Goto DeselectChildComponent
  1962. Else
  1963. Dim ChildNodeList As ArrayList = XObject2NodeList(ChildVSGUID)
  1964. Dim DependerVSGUID As String
  1965. Dim DependerNode As TreeNode
  1966. For Each DependerVSGUID In DependerList
  1967. If IsComponentSelected(DependerVSGUID) Then
  1968. ' We need to prevent "treenode incest":
  1969. ' The new parent (depender) can't be a child of the
  1970. ' child we are trying to find a new home for!
  1971. Dim ParentNode As TreeNode = XObject2DependencyTreeNode(DependerVSGUID)
  1972. Dim DependerName As String = ParentNode.Text
  1973. While Not ParentNode Is Nothing
  1974. If ParentNode Is ChildNode Then
  1975. DependerVSGUID = Nothing
  1976. ParentNode = Nothing
  1977. Else
  1978. ParentNode = ParentNode.Parent()
  1979. End If
  1980. End While
  1981. If Not DependerVSGUID Is Nothing Then
  1982. Goto FoundSelectedDepender
  1983. End If
  1984. Log("Rejected new parent due to incest: " & DependerName)
  1985. End If
  1986. Next
  1987. Log("No depender found for [" & ChildNode.Text & "].")
  1988. Goto DeselectChildComponent
  1989. FoundSelectedDepender:
  1990. DependerNode = XObject2DependencyTreeNode(DependerVSGUID)
  1991. Dim PlaceholderNode As TreeNode
  1992. For Each PlaceholderNode In DependerNode.Nodes
  1993. If ChildNodeList.Contains(PlaceholderNode) Then
  1994. ChildNodeList.Remove(PlaceholderNode)
  1995. Goto RemovePlaceholderNode
  1996. End If
  1997. Next
  1998. Goto MoveChildNodeToDependerNode
  1999. RemovePlaceholderNode: DependerNode.Nodes.Remove(PlaceholderNode)
  2000. MoveChildNodeToDependerNode: OrphanNode(ChildNode)
  2001. DependerNode.Nodes.Add(ChildNode)
  2002. Log("Moved [" & ChildNode.Text & "] to [" & DependerNode.Text & "] from [" & ComponentNode.Text + "].")
  2003. If ShowMovedNodes.Checked Then
  2004. Dim ParentNode As TreeNode = ChildNode.Parent
  2005. While Not ParentNode Is Nothing
  2006. ParentNode.Expand()
  2007. ParentNode = ParentNode.Parent
  2008. End While
  2009. End If
  2010. End If
  2011. Else ' go ahead and deselect the child
  2012. DeselectChildComponent: Log("Deselecting child component " & ChildVSGUID)
  2013. SetComponentSelected(ChildVSGUID, False, DependencyMode)
  2014. End If
  2015. End If
  2016. NextChildNode: Next ChildNode ' In ComponentNode.Nodes
  2017. OrphanNode(ComponentNode)
  2018. If XSelectedComponentNode2Component.Contains(ComponentNode) Then
  2019. XComponent2SelectedComponentNode.Remove(Component.VSGUID)
  2020. XSelectedComponentNode2Component.Remove(ComponentNode)
  2021. End If
  2022. Next ComponentNode ' in node list for deselected component
  2023. End If ' dependencies don't prevent deselection
  2024. End If
  2025. Else
  2026. If Not [Select] Then
  2027. Return
  2028. ElseIf IsComponentExcluded(Component) Then
  2029. Log("Select denied, component is exluded: " & Component.DisplayName)
  2030. Return
  2031. Else 'select component
  2032. Log("Select: " & Component.DisplayName)
  2033. SelectedComponents(Component.VSGUID) = True
  2034. ComponentNode = GetSelectedComponentNode(Component)
  2035. If Not XObject2NodeList(Component) Is Nothing Then
  2036. Dim Marked As ArrayList = New ArrayList()
  2037. For Each ComponentNode In XObject2NodeList(Component)
  2038. If Not ComponentNode.Checked Then
  2039. Marked.Add(ComponentNode)
  2040. End If
  2041. Next
  2042. For Each ComponentNode In Marked
  2043. ComponentNode.Checked = True
  2044. Next
  2045. End If
  2046. '
  2047. ' Automatic Dependency Resolution
  2048. '
  2049. ' There is alot of logic here that might not be that easy to
  2050. ' follow: there are several shortcuts taken in my
  2051. ' dependency resolution algorithm, and the GUI update code
  2052. ' is necessarily mixed in with the resolution logic. Thus,
  2053. ' I thought it would be a good idea to provide an outline
  2054. ' of the steps followed in the algorithm below.
  2055. '
  2056. ' boy, should this be moved into its own method ;-)
  2057. '
  2058. 'Dim GroupVSGUID As String
  2059. 'For Each GroupVSGUID In Component.GroupVSGUIDs
  2060. ' SetGroupSatisfied(GroupVSGUID, True)
  2061. 'Next
  2062. ComponentNode = InstanceTree.Nodes.Add(Component.DisplayName)
  2063. Dim Dependencies As CMI.Dependencies = Component.Dependencies()
  2064. Dim Dependency As CMI.Dependency
  2065. DependencyProgress_AddTasks(Component, Dependencies.Count())
  2066. For Each Dependency In Dependencies
  2067. Dim ClassName As String = [Enum].GetName(Dependency.Class.GetType, Dependency.Class)
  2068. Dim TypeName As String = [Enum].GetName(Dependency.Type.GetType, Dependency.Type)
  2069. ClassName = SS(ClassName).Remove(0, 3)
  2070. TypeName = SS(TypeName).Remove(0, 3)
  2071. Dim DependencyNodeName = SS(Dependency.DisplayName)
  2072. DependencyNodeName = "[" & ClassName & "!" & TypeName & "] " & DependencyNodeName
  2073. Dim DependencyNode As TreeNode = ComponentNode.Nodes.Add(DependencyNodeName)
  2074. Dim obj = CMI.CreateFromDB(ObjectTypeConsts.cmiUnknown, Dependency.PlatformVSGUID, FilterTypeConsts.cmiFTGetDepTarget, Dependency.TargetGUID)
  2075. Dim TargetComponent As CMI.Component
  2076. Dim TargetGroup As CMI.Group
  2077. If TypeOf obj Is CMI.IComponent Then
  2078. TargetComponent = obj
  2079. If Dependency.Class = DependencyClassConsts.cmiInclude Then
  2080. Dim Label As String = TargetComponent.DisplayName
  2081. Select Case Dependency.Type
  2082. Case DependencyTypeConsts.cmiAll, DependencyTypeConsts.cmiAtLeastOne, DependencyTypeConsts.cmiExactlyOne
  2083. ' automatically follow the dependency
  2084. RegisterDependanceOnComponent(Component.VSGUID, TargetComponent.VSGUID)
  2085. If ExcludedComponents(TargetComponent) Then
  2086. Label = "Target Component Excluded: " & Label
  2087. Else
  2088. SetComponentSelected(TargetComponent, True, DependencyMode, UsePlaceholders.Checked)
  2089. Label = "Target Component Added: " & Label
  2090. End If
  2091. Case DependencyTypeConsts.cmiZeroOrOne
  2092. Label = "Target Optional Component: " & Label
  2093. Case DependencyTypeConsts.cmiNone
  2094. Label = "Target Incompatible Component: " & Label
  2095. Case Else
  2096. Goto BadComponentDependency
  2097. End Select
  2098. RegisterNodeForComponent(TargetComponent.VSGUID, DependencyNode.Nodes.Add(Label))
  2099. Else
  2100. BadComponentDependency:
  2101. DependencyNode.Nodes.Add("Bad dependency on target component: " & TargetComponent.DisplayName)
  2102. End If
  2103. ElseIf TypeOf obj Is CMI.IGroup Then
  2104. TargetGroup = obj
  2105. If Dependency.Class = DependencyClassConsts.cmiInclude Then
  2106. Select Case Dependency.Type
  2107. Case DependencyTypeConsts.cmiAll
  2108. ' automatically follow the dependency
  2109. RegisterDependanceOnComponent(Component.VSGUID, TargetGroup.VSGUID)
  2110. SetGroupSelected(TargetGroup, True, DependencyMode, UsePlaceholders.Checked)
  2111. DependencyNode.Nodes.Add("Target Group Added: " & TargetGroup.DisplayName)
  2112. Case Else
  2113. LogErr("Multiple ways to satisfy dependency: include [" & GetEnumName(Dependency.Type) & "] from [" & TargetGroup.DisplayName & "]")
  2114. End Select
  2115. Else
  2116. LogErr("Multiple ways to satisfy dependency: [" & GetEnumName(Dependency.Class) & "] [" & GetEnumName(Dependency.Type) & "] from [" & TargetGroup.DisplayName & "]")
  2117. DependencyNode.Nodes.Add("Target Group: " & TargetGroup.DisplayName)
  2118. End If
  2119. ElseIf Not obj Is Nothing Then
  2120. DependencyNode.Nodes.Add("Target Object (???): " & SS(obj))
  2121. Else
  2122. DependencyNode.Nodes.Add("Target object not found!!! (" & SS(obj) & ")")
  2123. End If
  2124. DependencyProgress_CompleteTask()
  2125. Next 'Dependency
  2126. End If
  2127. End If
  2128. 'refresh component list
  2129. 'UpdateSelectedComponents()
  2130. End Sub
  2131. ' SetComponentExcluded adds or removes a component from the exluded list.
  2132. Public Sub SetComponentExcluded(ByRef __obj As Object, ByVal Exclude As Boolean)
  2133. ' we only need the real component to get its display name. oh well...
  2134. Dim Component As CMI.Component = GetComponent(__obj)
  2135. Dim ComponentNode As TreeNode
  2136. If ExcludedComponents(Component) Then
  2137. If Exclude Then
  2138. Return
  2139. Else ' unexlude component
  2140. ExcludedComponents(Component) = False
  2141. End If
  2142. Else
  2143. If Not Exclude Then
  2144. Return
  2145. Else ' exclude component
  2146. ExcludedComponents(Component) = True
  2147. SetComponentSelected(Component, False, DependencyModes.IgnoreOne)
  2148. ExcludedTree.Nodes.Add(GetComponentName(Component))
  2149. 'RefreshDependencies()
  2150. End If
  2151. End If
  2152. End Sub
  2153. #Region " Dependency Routines "
  2154. ' RegisterDependanceOnComponent records that the given Depender depends
  2155. ' on the given Component.
  2156. Private Sub RegisterDependanceOnComponent(ByVal DependerVSGUID As String, ByVal ComponentVSGUID As String)
  2157. GetDependerList(ComponentVSGUID).Add(DependerVSGUID)
  2158. End Sub
  2159. ' HasDepender indicates (given the dependency checking mode) whether or not
  2160. ' we know there are any components which depend on the specified component.
  2161. Public Function HasDepender(ByRef ComponentVSGUID As String, ByVal DependencyMode As DependencyModes) As Boolean
  2162. Select Case DependencyMode
  2163. Case DependencyModes.IgnoreNone
  2164. If XComponent2DependerList.Contains(ComponentVSGUID) Then
  2165. Dim VSGUID As String
  2166. For Each VSGUID In XComponent2DependerList(ComponentVSGUID)
  2167. If IsComponentSelected(VSGUID) Then
  2168. Log("Found dependence: " & GetComponentName(VSGUID) & " depends on " & GetComponentName(ComponentVSGUID))
  2169. Return True
  2170. End If
  2171. Next
  2172. Return False
  2173. Else
  2174. Return False
  2175. End If
  2176. Case DependencyModes.IgnoreAll, DependencyModes.IgnoreOne
  2177. Return False
  2178. End Select
  2179. End Function
  2180. #End Region ' Dependency Routines
  2181. #End Region
  2182. #Region " SetGroupSelected/Satisfied "
  2183. Private Sub SetGroupSelected(ByRef Group As CMI.Group, ByVal Selected As Boolean, Optional ByVal DependencyMode As DependencyModes = DependencyModes.IgnoreAll, Optional ByVal CreateDependencyTreePlaceholders As Boolean = False)
  2184. Dim Components As CMI.Components
  2185. Dim Component As CMI.Component
  2186. If SelectedGroups(Group) Then
  2187. If Selected Then
  2188. If CreateDependencyTreePlaceholders Then
  2189. DependencyProgress_AddCompleteTask(Group, Group.DisplayName)
  2190. End If
  2191. Return
  2192. Else 'deselect group
  2193. SelectedGroups(Group.VSGUID) = False
  2194. End If
  2195. Else
  2196. If Not Selected Then
  2197. Return
  2198. Else 'select group
  2199. SelectedGroups(Group.VSGUID) = True
  2200. Components = CMI.CreateFromDB(ObjectTypeConsts.cmiComponents, GetPlatform.VSGUID, FilterTypeConsts.cmiFTGetGroupMembers, Group.VSGUID)
  2201. DependencyProgress_AddTasks(Group, Components.Count)
  2202. For Each Component In Components
  2203. SetComponentSelected(Component, True, DependencyMode, CreateDependencyTreePlaceholders)
  2204. DependencyProgress_CompleteTask()
  2205. Next
  2206. End If
  2207. End If
  2208. ''refresh group list
  2209. 'UpdateGroupsList()
  2210. End Sub
  2211. ' Just enough is here to tell whether a group dependency has already
  2212. ' been satisfied when selecting components or groups.
  2213. ' Otherwise unimplemented.
  2214. Private Sub SetGroupSatisfied(ByVal GroupGUID As String, ByVal Satisfied As Boolean)
  2215. If SatisfiedGroups(GroupGUID) Then
  2216. If Satisfied Then
  2217. Return
  2218. Else ' newly satisfied group
  2219. SatisfiedGroups(GroupGUID) = True
  2220. ' satisfy dependencies ...
  2221. End If
  2222. Else
  2223. If Not Satisfied Then
  2224. Return
  2225. Else ' newly unsatisfied group
  2226. SatisfiedGroups(GroupGUID) = False
  2227. ' unsatisfy dependencies ...
  2228. End If
  2229. End If
  2230. End Sub
  2231. #End Region
  2232. #End Region
  2233. #Region " SelectedComponentsContextMenu "
  2234. Private Sub SelectedComponentsContextMenu_Popup(ByVal sender As Object, ByVal e As System.EventArgs) Handles SelectedComponentsContextMenu.Popup
  2235. FixSelectedComponentContextMenu(SelectedComponentsContextMenu.SourceControl)
  2236. End Sub
  2237. Private Sub ExpandAllCmd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExpandAllCmd.Click
  2238. Dim Tree As TreeView = SelectedComponentsContextMenu.SourceControl
  2239. Tree.ExpandAll()
  2240. End Sub
  2241. Private Sub CollapseAllCmd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CollapseAllCmd.Click
  2242. Dim Tree As TreeView = SelectedComponentsContextMenu.SourceControl
  2243. Tree.CollapseAll()
  2244. End Sub
  2245. Private Sub ShowComponentPropertiesCmd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShowComponentPropertiesCmd.Click
  2246. Dim Tree As TreeView = SelectedComponentsContextMenu.SourceControl
  2247. Dim Node As TreeNode = Tree.SelectedNode()
  2248. If Not Node Is Nothing Then
  2249. Dim CPF As ComponentPropertiesForm = New ComponentPropertiesForm(Me)
  2250. CPF.DisplayComponent(GetComponent(Node.Tag))
  2251. CPF.Show()
  2252. End If
  2253. End Sub
  2254. Private Sub ExcludeCmd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExcludeCmd.Click
  2255. Dim Tree As TreeView = SelectedComponentsContextMenu.SourceControl
  2256. Dim Node As TreeNode = Tree.SelectedNode()
  2257. If Not Node Is Nothing Then
  2258. SetComponentExcluded(Node.Tag, True)
  2259. End If
  2260. End Sub
  2261. Private Sub RemoveComponentCmd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RemoveComponentCmd.Click
  2262. Dim Tree As TreeView = SelectedComponentsContextMenu.SourceControl
  2263. Dim Node As TreeNode = Tree.SelectedNode()
  2264. If Not Node Is Nothing Then
  2265. SetObjectSelected(Node.Tag, False, DependencyModes.IgnoreOne)
  2266. End If
  2267. End Sub
  2268. Private Sub RemoveAllComponentsCmd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RemoveAllComponentsCmd.Click
  2269. Dim Tree As TreeView = SelectedComponentsContextMenu.SourceControl
  2270. Dim Node As TreeNode
  2271. For Each Node In Tree.Nodes
  2272. SetObjectSelected(Node.Tag, False, DependencyModes.IgnoreAll)
  2273. Next
  2274. End Sub
  2275. ' this functionality is obsolete -- SetComponentSelected() keeps everything in sync
  2276. Private Sub RefreshSelectedComponentsCmd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RefreshSelectedComponentsCmd.Click
  2277. 'SelectedComponentTree.BeginUpdate()
  2278. SelectedComponentTree.Nodes.Clear()
  2279. DependencyTree.Nodes.Clear()
  2280. XComponent2SelectedComponentNode.Clear()
  2281. UpdateSelectedComponents()
  2282. 'SelectedComponentTree.EndUpdate()
  2283. End Sub
  2284. #End Region
  2285. #Region " Files Tab "
  2286. Private Sub FindComponents_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FindComponents.Click
  2287. FindComponents.Enabled = False
  2288. UncookAllComponents()
  2289. FindComponents.Enabled = True
  2290. End Sub
  2291. ' FilenameTree_AfterCheck handles clicks on the filename node checkboxes
  2292. ' as well as the component node checkboxes from the File tab's tree.
  2293. Private IN_FilenameTree_AfterCheck As Boolean = False
  2294. Private Sub FilenameTree_AfterCheck(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles FilenameTree.AfterCheck
  2295. Dim ComponentNode As TreeNode
  2296. Dim ComponentVSGUID As String 'CMI.Component
  2297. Dim Filename
  2298. Dim FileNode As TreeNode
  2299. Dim NodeFilenames As ArrayList
  2300. Dim SelectedComponentNode As TreeNode
  2301. ComponentNode = e.Node
  2302. ComponentVSGUID = XNode2Component(ComponentNode)
  2303. Filename = ComponentNode.Text
  2304. If ComponentVSGUID Is Nothing Then
  2305. If IN_FilenameTree_AfterCheck Then
  2306. Return
  2307. End If
  2308. FileNode = ComponentNode
  2309. For Each ComponentNode In ComponentNode.Nodes
  2310. If Not ComponentNode.Checked = FileNode.Checked Then
  2311. ComponentNode.Checked = FileNode.Checked
  2312. End If
  2313. Next
  2314. Else
  2315. IN_FilenameTree_AfterCheck = True
  2316. NodeFilenames = XComponent2FilenameList(ComponentVSGUID)
  2317. If ComponentNode.Checked Then
  2318. If SelectedComponents(ComponentVSGUID) Is Nothing Then
  2319. SelectedComponents(ComponentVSGUID) = True
  2320. For Each Filename In NodeFilenames
  2321. FileNode = XFilename2Node(Filename)
  2322. If Not FileNode Is Nothing Then
  2323. FileNode.Checked = True
  2324. End If
  2325. Next
  2326. End If
  2327. Else 'component is not checked
  2328. If Not SelectedComponents(ComponentVSGUID) Is Nothing Then
  2329. SelectedComponents.Remove(ComponentVSGUID)
  2330. SelectedComponentTree.Nodes.Remove(XComponent2SelectedComponentNode(ComponentVSGUID))
  2331. XComponent2SelectedComponentNode.Remove(ComponentVSGUID)
  2332. For Each Filename In NodeFilenames
  2333. For Each ComponentVSGUID In XFilename2ComponentList(Filename)
  2334. If SelectedComponents(ComponentVSGUID) Then
  2335. Goto FinishedLookingForSelectedComponent
  2336. End If
  2337. Next
  2338. FileNode = XFilename2Node(Filename)
  2339. If Not FileNode Is Nothing Then
  2340. FileNode.Checked = False
  2341. End If
  2342. FinishedLookingForSelectedComponent:
  2343. Next
  2344. End If
  2345. End If 'component is not checked
  2346. 'UpdateSelectedComponents()
  2347. End If 'component is not null
  2348. IN_FilenameTree_AfterCheck = False
  2349. End Sub
  2350. ' This just makes sure the component nodes in the filename tree are
  2351. ' checked properly. Again, obsoleted by SetComponentSelected(),
  2352. ' but it doesn't really hurt to make sure.
  2353. Private Sub FilenameTree_BeforeExpand(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewCancelEventArgs)
  2354. Dim ComponentNode As TreeNode
  2355. Dim ComponentVSGUID As String 'CMI.Component
  2356. For Each ComponentNode In e.Node.Nodes
  2357. ComponentVSGUID = XNode2Component(ComponentNode)
  2358. If Not ComponentVSGUID Is Nothing And Not ComponentNode.Checked = SelectedComponents(ComponentVSGUID) Then
  2359. ComponentNode.Checked = SelectedComponents(ComponentVSGUID)
  2360. End If
  2361. Next
  2362. End Sub
  2363. #End Region
  2364. #Region " Extra/Missing Files Tabs "
  2365. ' I never got around to implementing the extar and missing files tabs,
  2366. ' but some support for the UI is here. Adding the code to maintain the
  2367. ' lists would be fairly simple, just more crap to add to
  2368. ' SetComponentSelected().
  2369. ' Saves the missing file list to a text file. Of course, since I never
  2370. ' implemented missing files, this isn't so useful.
  2371. Private Sub SaveMissingFilesList_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveMissingFilesList.Click
  2372. Dim MFFile As Integer = FileSystem.FreeFile
  2373. Dim Line As Object
  2374. Cursor.Current = Cursors.WaitCursor
  2375. FileSystem.FileOpen(MFFile, MissingFilesPath.Text, OpenMode.Output, OpenAccess.Write)
  2376. For Each Line In MissingFilesList.Items
  2377. PrintLine(MFFile, Line)
  2378. Next
  2379. FileSystem.FileClose(MFFile)
  2380. End Sub
  2381. ' this isn't really implemented yet.
  2382. Private Sub RefreshMissingFiles_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RefreshMissingFiles.Click
  2383. Dim FileNode As TreeNode
  2384. MissingFilesList.Items.Clear()
  2385. For Each FileNode In FilenameTree.Nodes
  2386. If Not FileNode.Checked Then
  2387. MissingFilesList.Items.Add(FileNode.Text)
  2388. End If
  2389. Next
  2390. End Sub
  2391. ' this isn't really implemented yet.
  2392. Private Sub RefreshExtraFiles_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RefreshExtraFiles.Click
  2393. Dim ExtraFileSet As Hashtable = New Hashtable()
  2394. Dim ComponentVSGUID As String
  2395. Dim Filename As String
  2396. For Each ComponentVSGUID In SelectedComponents.Keys
  2397. If SelectedComponents(ComponentVSGUID) Then
  2398. For Each Filename In XComponent2FilenameList(ComponentVSGUID)
  2399. If Not Filenames.Contains(Filename) Then
  2400. ExtraFileSet(Filename) = True
  2401. End If
  2402. Next
  2403. End If
  2404. Next
  2405. ExtraFilesList.Items.Clear()
  2406. ExtraFilesList.Items.AddRange(ExtraFileSet.Keys)
  2407. End Sub
  2408. #End Region
  2409. #Region " Groups Tab "
  2410. ' Checking a group node selects all the components in that group.
  2411. ' Unchecking a group node deselects all the components in that group.
  2412. Private Sub GroupList_AfterCheck(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles GroupList.AfterCheck
  2413. If XGroupNode2Group.Contains(e.Node) Then
  2414. SetGroupSelected(XGroupNode2Group(e.Node), e.Node.Checked)
  2415. ElseIf XNode2Component.Contains(e.Node) Then
  2416. Dim ComponentVSGUID As String = XNode2Component(e.Node)
  2417. SetComponentSelected(ComponentVSGUID, e.Node.Checked)
  2418. End If
  2419. End Sub
  2420. ' Here we replace that empty placeholder node with the actual contents
  2421. ' of the group. A node is added as a child of the group node for each
  2422. ' component in that group.
  2423. Private Sub GroupList_BeforeExpand(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewCancelEventArgs) Handles GroupList.BeforeExpand
  2424. Dim Node As TreeNode = e.Node
  2425. 'Node = GroupList.GetNodeAt(GroupList.PointToClient(GroupList.MousePosition))
  2426. Dim I As IEnumerator = Node.Nodes.GetEnumerator
  2427. If I.MoveNext() And I.Current.Text Is "" Then ' empty placeholder found
  2428. Node.Nodes.Clear() ' get rid of placeholder
  2429. Dim Group As CMI.Group = XGroupNode2Group(Node)
  2430. Dim Components As CMI.Components = CMI.CreateFromDB(ObjectTypeConsts.cmiComponents, Group.PlatformVSGUID, FilterTypeConsts.cmiFTGetGroupMembers, Group.VSGUID)
  2431. Dim Component As CMI.Component
  2432. For Each Component In Components
  2433. Dim ComponentVSGUID As String = Component.VSGUID
  2434. Dim ComponentNode As TreeNode
  2435. ComponentNode = Node.Nodes.Add(GetComponentName(Component))
  2436. RegisterNodeForComponent(ComponentVSGUID, ComponentNode)
  2437. Next
  2438. End If
  2439. End Sub
  2440. Private Sub GetGroupsButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GetGroupsButton.Click
  2441. GetGroupsFromDB()
  2442. End Sub
  2443. #End Region
  2444. #Region " Dependancies Tab "
  2445. ' Here we replace that empty placeholder node with the actual list of
  2446. ' files which the component provides. A node is added as a child of the
  2447. ' component node for each file in the component's filename list.
  2448. Private Sub SelectedComponentTree_BeforeExpand(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewCancelEventArgs) Handles SelectedComponentTree.BeforeExpand
  2449. Dim I As IEnumerator = e.Node.Nodes.GetEnumerator
  2450. If I.MoveNext() And I.Current.Text Is "" Then ' empty placeholder found
  2451. e.Node.Nodes.Clear() ' get rid of placeholder
  2452. Dim ComponentVSGUID As String = XSelectedComponentNode2Component(e.Node)
  2453. UncookComponent(ComponentVSGUID)
  2454. Dim Filename As String
  2455. Dim FileNode As TreeNode
  2456. Dim ComponentNode As TreeNode = XComponent2SelectedComponentNode(ComponentVSGUID)
  2457. For Each Filename In XComponent2FilenameList(ComponentVSGUID)
  2458. FileNode = ComponentNode.Nodes.Add(Filename)
  2459. If Filenames.ContainsKey(Filename) Then
  2460. Bold(FileNode)
  2461. End If
  2462. Next
  2463. End If
  2464. End Sub
  2465. #End Region
  2466. #Region " Configuration Tab "
  2467. Private Sub SaveSLX_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveSLX.Click
  2468. Dim Configuration As CMI.Configuration
  2469. Dim ComponentNode As TreeNode
  2470. Dim ComponentVSGUID As String
  2471. Dim Component As CMI.Component
  2472. LoadSLX.Enabled = False
  2473. SaveSLX.Enabled = False
  2474. EnsureCMI()
  2475. Configuration = CreateConfiguration()
  2476. 'Dim Tasks As CMI.Tasks = Configuration.CheckDependencies(0)
  2477. 'Dim Task As CMI.Task
  2478. 'For Each Task In Tasks
  2479. ' InstanceTree.Nodes.Add(Task.DisplayName & " (" & Task.Description & ")")
  2480. 'Next
  2481. Dim FileName As String = SLXPath.Text
  2482. ' If BackupSLX.Checked Then
  2483. ' Dim I As Integer = 0
  2484. ' FileName = FileName & ".slx"
  2485. ' On Error Goto FoundEmptyFile
  2486. ' While FileSystem.FileLen(FileName) > 0
  2487. ' FileName = SLXPath.Text & "." & I.ToString & ".slx"
  2488. ' I = I + 1
  2489. ' End While
  2490. 'FoundEmptyFile:
  2491. ' End If
  2492. SaveConfigurationToFile(Configuration, FileName)
  2493. 'ByComponentTab.Text = FileName
  2494. LoadSLX.Enabled = True
  2495. SaveSLX.Enabled = True
  2496. End Sub
  2497. Private Sub LoadSLX_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadSLX.Click
  2498. Dim Configuration As CMI.Configuration
  2499. Dim ComponentNode As TreeNode
  2500. Dim Instance As CMI.Instance
  2501. Dim Component As CMI.Component
  2502. Dim FindWasEnabled As Boolean = FindComponents.Enabled
  2503. LoadSLX.Enabled = False
  2504. SaveSLX.Enabled = False
  2505. EnsureCMI()
  2506. Configuration = LoadConfigurationFromFile(SLXPath.Text)
  2507. Dim ComponentVSGUID As String
  2508. Dim comps = New ArrayList(SelectedComponents.Keys)
  2509. For Each ComponentVSGUID In comps
  2510. SetComponentSelected(ComponentVSGUID, False)
  2511. Next
  2512. 'DependencyProgress_AddTasks(Nothing, Configuration.Instances.Count)
  2513. DependenciesToProcessCount = DependenciesToProcessCount + Configuration.Instances.Count
  2514. For Each Instance In Configuration.Instances
  2515. 'DependencyProgress_AddTasks(Nothing, Instance.CompChainVSGUIDs.Count
  2516. For Each ComponentVSGUID In Instance.CompChainVSGUIDs
  2517. SetComponentSelected(ComponentVSGUID, True)
  2518. Next
  2519. SelectedComponentTree.Refresh()
  2520. DependenciesProcessedCount = DependenciesProcessedCount + 1
  2521. DependencyProgress_Update()
  2522. 'DependencyProgress_CompleteTask()
  2523. Next
  2524. FindComponents.Enabled = FindWasEnabled
  2525. 'UpdateSelectedComponents()
  2526. LoadSLX.Enabled = True
  2527. SaveSLX.Enabled = True
  2528. End Sub
  2529. Private Sub BuildImage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BuildImage.Click
  2530. Dim Configuration As CMI.Configuration = CreateConfiguration()
  2531. StatusBar.Text = "Configuration Complete. Building..."
  2532. Configuration.Build(0, BuildPath.Text)
  2533. StatusBar.Text = "Build Complete."
  2534. End Sub
  2535. ' Untested attempt at making sure no orphaned (unneeded) components remain
  2536. ' in the configuration. If this method actually deselects any components,
  2537. ' then something is wrong in the dependency/selection/deselection logic.
  2538. Private Sub AutoCull_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AutoCull.Click
  2539. Dim Node As TreeNode
  2540. For Each Node In SelectedComponentTree.Nodes
  2541. Dim VSGUID As String = Node.Tag
  2542. If IsComponentSelected(VSGUID) And Not HasDepender(VSGUID, DependencyModes.IgnoreNone) Then
  2543. SetComponentSelected(Node.Tag, False)
  2544. End If
  2545. Next
  2546. End Sub
  2547. #End Region
  2548. #Region " Status Bar "
  2549. Private Sub StatusBarGroup_PanelClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.StatusBarPanelClickEventArgs) Handles StatusBarGroup.PanelClick
  2550. If e.StatusBarPanel() Is LogStatus Then
  2551. LogWindow.Visible = Not LogWindow.Visible
  2552. End If
  2553. End Sub
  2554. Sub SyncLogStatus2LogWindow()
  2555. Select Case LogWindow.Visible
  2556. Case True
  2557. LogStatus.BorderStyle = StatusBarPanelBorderStyle.Sunken
  2558. Case False
  2559. LogStatus.BorderStyle = StatusBarPanelBorderStyle.None
  2560. End Select
  2561. End Sub
  2562. Private Sub StatusBarGroup_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles StatusBarGroup.MouseEnter
  2563. LogStatus.BorderStyle = StatusBarPanelBorderStyle.Raised
  2564. End Sub
  2565. Private Sub StatusBarGroup_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles StatusBarGroup.MouseLeave
  2566. SyncLogStatus2LogWindow()
  2567. End Sub
  2568. #End Region
  2569. End Class