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.

361 lines
15 KiB

  1. Public Class ComponentPropertiesForm
  2. Inherits System.Windows.Forms.Form
  3. #Region " Windows Form Designer generated code "
  4. Private Sub New()
  5. MyBase.New()
  6. 'This call is required by the Windows Form Designer.
  7. InitializeComponent()
  8. 'Add any initialization after the InitializeComponent() call
  9. End Sub
  10. 'Form overrides dispose to clean up the component list.
  11. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  12. If disposing Then
  13. If Not (components Is Nothing) Then
  14. components.Dispose()
  15. End If
  16. End If
  17. MyBase.Dispose(disposing)
  18. End Sub
  19. Friend WithEvents PanelHeader As System.Windows.Forms.Panel
  20. Friend WithEvents Panel2 As System.Windows.Forms.Panel
  21. Friend WithEvents Selected As System.Windows.Forms.CheckBox
  22. Friend WithEvents Excluded As System.Windows.Forms.CheckBox
  23. Friend WithEvents Uncooked As System.Windows.Forms.CheckBox
  24. Friend WithEvents Panel1 As System.Windows.Forms.Panel
  25. Friend WithEvents ScriptText As System.Windows.Forms.RichTextBox
  26. Friend WithEvents ScriptLabel As System.Windows.Forms.Label
  27. Friend WithEvents Tabs As System.Windows.Forms.TabControl
  28. Friend WithEvents ScriptTab As System.Windows.Forms.TabPage
  29. Friend WithEvents DependerTab As System.Windows.Forms.TabPage
  30. Friend WithEvents Panel3 As System.Windows.Forms.Panel
  31. Friend WithEvents DepLabel As System.Windows.Forms.Label
  32. Friend WithEvents DepList As System.Windows.Forms.ListBox
  33. Friend WithEvents PrototypeList As System.Windows.Forms.ComboBox
  34. Friend WithEvents VIGUID As System.Windows.Forms.TextBox
  35. Friend WithEvents Label1 As System.Windows.Forms.Label
  36. Friend WithEvents VSGUID As System.Windows.Forms.TextBox
  37. Friend WithEvents Label2 As System.Windows.Forms.Label
  38. Friend WithEvents Label3 As System.Windows.Forms.Label
  39. 'Required by the Windows Form Designer
  40. Private components As System.ComponentModel.Container
  41. 'NOTE: The following procedure is required by the Windows Form Designer
  42. 'It can be modified using the Windows Form Designer.
  43. 'Do not modify it using the code editor.
  44. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  45. Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(ComponentPropertiesForm))
  46. Me.DependerTab = New System.Windows.Forms.TabPage()
  47. Me.Panel3 = New System.Windows.Forms.Panel()
  48. Me.DepList = New System.Windows.Forms.ListBox()
  49. Me.DepLabel = New System.Windows.Forms.Label()
  50. Me.PanelHeader = New System.Windows.Forms.Panel()
  51. Me.PrototypeList = New System.Windows.Forms.ComboBox()
  52. Me.Uncooked = New System.Windows.Forms.CheckBox()
  53. Me.Excluded = New System.Windows.Forms.CheckBox()
  54. Me.Selected = New System.Windows.Forms.CheckBox()
  55. Me.ScriptText = New System.Windows.Forms.RichTextBox()
  56. Me.Tabs = New System.Windows.Forms.TabControl()
  57. Me.ScriptTab = New System.Windows.Forms.TabPage()
  58. Me.Panel1 = New System.Windows.Forms.Panel()
  59. Me.ScriptLabel = New System.Windows.Forms.Label()
  60. Me.Panel2 = New System.Windows.Forms.Panel()
  61. Me.VIGUID = New System.Windows.Forms.TextBox()
  62. Me.Label1 = New System.Windows.Forms.Label()
  63. Me.VSGUID = New System.Windows.Forms.TextBox()
  64. Me.Label2 = New System.Windows.Forms.Label()
  65. Me.Label3 = New System.Windows.Forms.Label()
  66. Me.DependerTab.SuspendLayout()
  67. Me.Panel3.SuspendLayout()
  68. Me.PanelHeader.SuspendLayout()
  69. Me.Tabs.SuspendLayout()
  70. Me.ScriptTab.SuspendLayout()
  71. Me.Panel1.SuspendLayout()
  72. Me.Panel2.SuspendLayout()
  73. Me.SuspendLayout()
  74. '
  75. 'DependerTab
  76. '
  77. Me.DependerTab.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel3, Me.DepLabel})
  78. Me.DependerTab.DockPadding.All = 2
  79. Me.DependerTab.Location = New System.Drawing.Point(4, 22)
  80. Me.DependerTab.Name = "DependerTab"
  81. Me.DependerTab.Size = New System.Drawing.Size(304, 144)
  82. Me.DependerTab.TabIndex = 0
  83. Me.DependerTab.Text = "Dependers"
  84. '
  85. 'Panel3
  86. '
  87. Me.Panel3.Controls.AddRange(New System.Windows.Forms.Control() {Me.DepList})
  88. Me.Panel3.Dock = System.Windows.Forms.DockStyle.Fill
  89. Me.Panel3.Location = New System.Drawing.Point(2, 25)
  90. Me.Panel3.Name = "Panel3"
  91. Me.Panel3.Size = New System.Drawing.Size(300, 117)
  92. Me.Panel3.TabIndex = 2
  93. '
  94. 'DepList
  95. '
  96. Me.DepList.Dock = System.Windows.Forms.DockStyle.Fill
  97. Me.DepList.Name = "DepList"
  98. Me.DepList.Size = New System.Drawing.Size(300, 108)
  99. Me.DepList.TabIndex = 0
  100. '
  101. 'DepLabel
  102. '
  103. Me.DepLabel.Dock = System.Windows.Forms.DockStyle.Top
  104. Me.DepLabel.Location = New System.Drawing.Point(2, 2)
  105. Me.DepLabel.Name = "DepLabel"
  106. Me.DepLabel.Size = New System.Drawing.Size(300, 23)
  107. Me.DepLabel.TabIndex = 1
  108. Me.DepLabel.Text = "These components depend on this component:"
  109. '
  110. 'PanelHeader
  111. '
  112. Me.PanelHeader.Controls.AddRange(New System.Windows.Forms.Control() {Me.Label3, Me.VSGUID, Me.Label2, Me.Label1, Me.VIGUID, Me.PrototypeList, Me.Uncooked, Me.Excluded, Me.Selected})
  113. Me.PanelHeader.Dock = System.Windows.Forms.DockStyle.Top
  114. Me.PanelHeader.Name = "PanelHeader"
  115. Me.PanelHeader.Size = New System.Drawing.Size(312, 96)
  116. Me.PanelHeader.TabIndex = 2
  117. '
  118. 'PrototypeList
  119. '
  120. Me.PrototypeList.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  121. Or System.Windows.Forms.AnchorStyles.Right)
  122. Me.PrototypeList.DropDownWidth = 312
  123. Me.PrototypeList.Location = New System.Drawing.Point(64, 48)
  124. Me.PrototypeList.Name = "PrototypeList"
  125. Me.PrototypeList.Size = New System.Drawing.Size(248, 21)
  126. Me.PrototypeList.TabIndex = 3
  127. '
  128. 'Uncooked
  129. '
  130. Me.Uncooked.Location = New System.Drawing.Point(0, 72)
  131. Me.Uncooked.Name = "Uncooked"
  132. Me.Uncooked.TabIndex = 2
  133. Me.Uncooked.Text = "Uncooked"
  134. '
  135. 'Excluded
  136. '
  137. Me.Excluded.Location = New System.Drawing.Point(208, 72)
  138. Me.Excluded.Name = "Excluded"
  139. Me.Excluded.TabIndex = 1
  140. Me.Excluded.Text = "Excluded"
  141. '
  142. 'Selected
  143. '
  144. Me.Selected.Location = New System.Drawing.Point(104, 72)
  145. Me.Selected.Name = "Selected"
  146. Me.Selected.TabIndex = 0
  147. Me.Selected.Text = "Selected"
  148. '
  149. 'ScriptText
  150. '
  151. Me.ScriptText.Dock = System.Windows.Forms.DockStyle.Fill
  152. Me.ScriptText.Name = "ScriptText"
  153. Me.ScriptText.Size = New System.Drawing.Size(300, 117)
  154. Me.ScriptText.TabIndex = 0
  155. Me.ScriptText.Text = "RichTextBox1"
  156. '
  157. 'Tabs
  158. '
  159. Me.Tabs.Controls.AddRange(New System.Windows.Forms.Control() {Me.DependerTab, Me.ScriptTab})
  160. Me.Tabs.Dock = System.Windows.Forms.DockStyle.Fill
  161. Me.Tabs.Name = "Tabs"
  162. Me.Tabs.SelectedIndex = 0
  163. Me.Tabs.Size = New System.Drawing.Size(312, 170)
  164. Me.Tabs.TabIndex = 1
  165. '
  166. 'ScriptTab
  167. '
  168. Me.ScriptTab.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel1, Me.ScriptLabel})
  169. Me.ScriptTab.DockPadding.All = 2
  170. Me.ScriptTab.Location = New System.Drawing.Point(4, 22)
  171. Me.ScriptTab.Name = "ScriptTab"
  172. Me.ScriptTab.Size = New System.Drawing.Size(304, 144)
  173. Me.ScriptTab.TabIndex = 0
  174. Me.ScriptTab.Text = "Script"
  175. '
  176. 'Panel1
  177. '
  178. Me.Panel1.Controls.AddRange(New System.Windows.Forms.Control() {Me.ScriptText})
  179. Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
  180. Me.Panel1.Location = New System.Drawing.Point(2, 25)
  181. Me.Panel1.Name = "Panel1"
  182. Me.Panel1.Size = New System.Drawing.Size(300, 117)
  183. Me.Panel1.TabIndex = 2
  184. '
  185. 'ScriptLabel
  186. '
  187. Me.ScriptLabel.Dock = System.Windows.Forms.DockStyle.Top
  188. Me.ScriptLabel.Location = New System.Drawing.Point(2, 2)
  189. Me.ScriptLabel.Name = "ScriptLabel"
  190. Me.ScriptLabel.Size = New System.Drawing.Size(300, 23)
  191. Me.ScriptLabel.TabIndex = 1
  192. '
  193. 'Panel2
  194. '
  195. Me.Panel2.Controls.AddRange(New System.Windows.Forms.Control() {Me.Tabs})
  196. Me.Panel2.Dock = System.Windows.Forms.DockStyle.Fill
  197. Me.Panel2.Location = New System.Drawing.Point(0, 96)
  198. Me.Panel2.Name = "Panel2"
  199. Me.Panel2.Size = New System.Drawing.Size(312, 170)
  200. Me.Panel2.TabIndex = 3
  201. '
  202. 'VIGUID
  203. '
  204. Me.VIGUID.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  205. Or System.Windows.Forms.AnchorStyles.Right)
  206. Me.VIGUID.Location = New System.Drawing.Point(64, 0)
  207. Me.VIGUID.Name = "VIGUID"
  208. Me.VIGUID.Size = New System.Drawing.Size(248, 20)
  209. Me.VIGUID.TabIndex = 4
  210. Me.VIGUID.Text = ""
  211. '
  212. 'Label1
  213. '
  214. Me.Label1.Name = "Label1"
  215. Me.Label1.Size = New System.Drawing.Size(56, 16)
  216. Me.Label1.TabIndex = 5
  217. Me.Label1.Text = "VIGUID"
  218. Me.Label1.TextAlign = System.Drawing.ContentAlignment.BottomRight
  219. '
  220. 'VSGUID
  221. '
  222. Me.VSGUID.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  223. Or System.Windows.Forms.AnchorStyles.Right)
  224. Me.VSGUID.Location = New System.Drawing.Point(64, 24)
  225. Me.VSGUID.Name = "VSGUID"
  226. Me.VSGUID.Size = New System.Drawing.Size(248, 20)
  227. Me.VSGUID.TabIndex = 4
  228. Me.VSGUID.Text = ""
  229. '
  230. 'Label2
  231. '
  232. Me.Label2.Location = New System.Drawing.Point(0, 24)
  233. Me.Label2.Name = "Label2"
  234. Me.Label2.Size = New System.Drawing.Size(56, 16)
  235. Me.Label2.TabIndex = 5
  236. Me.Label2.Text = "VSGUID"
  237. Me.Label2.TextAlign = System.Drawing.ContentAlignment.BottomRight
  238. '
  239. 'Label3
  240. '
  241. Me.Label3.Location = New System.Drawing.Point(0, 48)
  242. Me.Label3.Name = "Label3"
  243. Me.Label3.Size = New System.Drawing.Size(56, 16)
  244. Me.Label3.TabIndex = 5
  245. Me.Label3.Text = "Parents"
  246. Me.Label3.TextAlign = System.Drawing.ContentAlignment.BottomRight
  247. '
  248. 'ComponentPropertiesForm
  249. '
  250. Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
  251. Me.ClientSize = New System.Drawing.Size(312, 266)
  252. Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel2, Me.PanelHeader})
  253. Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
  254. Me.Name = "ComponentPropertiesForm"
  255. Me.Text = "ComponentPropertiesForm"
  256. Me.DependerTab.ResumeLayout(False)
  257. Me.Panel3.ResumeLayout(False)
  258. Me.PanelHeader.ResumeLayout(False)
  259. Me.Tabs.ResumeLayout(False)
  260. Me.ScriptTab.ResumeLayout(False)
  261. Me.Panel1.ResumeLayout(False)
  262. Me.Panel2.ResumeLayout(False)
  263. Me.ResumeLayout(False)
  264. End Sub
  265. #End Region
  266. Private Form1 As Form1
  267. Private Component As CMI.Component
  268. Sub New(ByRef Form1 As Form1)
  269. Me.New()
  270. Me.Form1 = Form1
  271. End Sub
  272. Function Null(ByRef obj As Object) As Boolean
  273. Return obj Is Nothing Or TypeOf obj Is DBNull
  274. End Function
  275. Public Sub DisplayComponent(ByVal Component As CMI.Component)
  276. Me.Component = Component
  277. Me.Text = Form1.GetComponentName(Component)
  278. Sync()
  279. Me.VIGUID.Text = Component.VIGUID
  280. Me.VSGUID.Text = Component.VSGUID
  281. PrototypeList.Items.Clear()
  282. Dim ParentComponent As CMI.Component = Component
  283. Do
  284. Dim i As String = Form1.GetComponentName(ParentComponent)
  285. PrototypeList.Items.Insert(0, i)
  286. PrototypeList.Text = i
  287. ParentComponent = Form1.GetComponent(ParentComponent.PrototypeVIGUID)
  288. Loop While Not ParentComponent Is Nothing
  289. ScriptText.Enabled = False
  290. While Not ScriptText.Enabled And Not Null(Component.PrototypeVIGUID) And Not Component.PrototypeVIGUID Is ""
  291. Try
  292. ScriptText.Enabled = Not Null(Component.ScriptText)
  293. Catch COMErr As System.Runtime.InteropServices.COMException
  294. Component = Form1.GetComponent(Component.PrototypeVIGUID)
  295. End Try
  296. End While
  297. If ScriptText.Enabled Then
  298. ScriptText.Text = Component.ScriptText
  299. 'If Not Null(Component.ScriptLanguage) Then
  300. ScriptLabel.Text = "Component: " & Form1.GetComponentName(Component)
  301. ScriptLabel.Text &= "\nLanguage: " & Component.ScriptLanguage
  302. 'End If
  303. Else
  304. ScriptLabel.Text = "(component has no script)"
  305. ScriptText.Text = ""
  306. End If
  307. Dim VSGUID As String
  308. For Each VSGUID In Form1.GetDependerList(Component.VSGUID)
  309. DepList.Items.Add(Form1.GetComponentName(VSGUID))
  310. Next VSGUID
  311. End Sub
  312. Sub Sync()
  313. Uncooked.Checked = Form1.IsComponentUncooked(Component)
  314. Selected.Checked = Form1.IsComponentSelected(Component)
  315. Excluded.Checked = Form1.IsComponentExcluded(Component)
  316. Uncooked.Enabled = Not Uncooked.Checked
  317. Selected.Enabled = Not Excluded.Checked
  318. Excluded.Enabled = Not Selected.Checked
  319. End Sub
  320. Private Sub Uncooked_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Uncooked.CheckedChanged
  321. If Uncooked.Checked Then
  322. If Not Form1.IsComponentUncooked(Component) Then
  323. Form1.UncookComponent(Component)
  324. End If
  325. End If
  326. Sync()
  327. End Sub
  328. Private Sub Selected_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Selected.CheckedChanged
  329. Form1.SetComponentSelected(Component, Selected.Checked)
  330. Sync()
  331. End Sub
  332. Private Sub Excluded_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Excluded.CheckedChanged
  333. Form1.SetComponentExcluded(Component, Excluded.Checked)
  334. Sync()
  335. End Sub
  336. End Class