DriveInfo.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using NEROLib;
  7. namespace LYFZ.NeroDiscBurn.NET
  8. {
  9. /// <summary>
  10. /// Summary description for DriveInfo.
  11. /// </summary>
  12. public class DriveInfoForm : System.Windows.Forms.Form
  13. {
  14. private NeroDrive m_drive;
  15. private Nero m_nero;
  16. private ChooseMediaForm m_frmChooseMedia;
  17. private System.Windows.Forms.Label label1;
  18. private System.Windows.Forms.TextBox c_HostAdapterName;
  19. private System.Windows.Forms.TextBox c_HostAdapterNumber;
  20. private System.Windows.Forms.Label label2;
  21. private System.Windows.Forms.Button c_Close;
  22. private System.Windows.Forms.TextBox c_DeviceID;
  23. private System.Windows.Forms.Label label3;
  24. private System.Windows.Forms.TextBox c_DeviceType;
  25. private System.Windows.Forms.Label label4;
  26. private System.Windows.Forms.TextBox c_DriveLetter;
  27. private System.Windows.Forms.Label label5;
  28. private System.Windows.Forms.Label label6;
  29. private System.Windows.Forms.ListView c_Capabilities;
  30. private System.Windows.Forms.Label label7;
  31. private System.Windows.Forms.TextBox c_BufUnderrunProt;
  32. private System.Windows.Forms.Label label8;
  33. private System.Windows.Forms.TextBox c_MediaSupport;
  34. private System.Windows.Forms.Label label9;
  35. private System.Windows.Forms.TextBox c_MediaReadSupport;
  36. private System.Windows.Forms.Label label10;
  37. private System.Windows.Forms.TextBox c_MandatoryBUPSpeed;
  38. private System.Windows.Forms.Label label11;
  39. private System.Windows.Forms.ListView c_SupportedAccessModes;
  40. private System.Windows.Forms.GroupBox groupBox1;
  41. private SpeedComboBox c_ReadSpeeds;
  42. private SpeedComboBox c_WriteSpeeds;
  43. private System.Windows.Forms.Label label12;
  44. private System.Windows.Forms.Label label13;
  45. private System.Windows.Forms.Button c_ChooseMedia;
  46. /// <summary>
  47. /// Required designer variable.
  48. /// </summary>
  49. private System.ComponentModel.Container components = null;
  50. public DriveInfoForm(Nero nero, NeroDrive drive)
  51. {
  52. //
  53. // Required for Windows Form Designer support
  54. //
  55. InitializeComponent();
  56. c_ReadSpeeds.m_bUseMaximum = false;
  57. c_WriteSpeeds.m_bUseMaximum = false;
  58. m_nero = nero;
  59. m_drive = drive;
  60. m_frmChooseMedia = new ChooseMediaForm (m_nero);
  61. }
  62. /// <summary>
  63. /// Clean up any resources being used.
  64. /// </summary>
  65. protected override void Dispose( bool disposing )
  66. {
  67. if( disposing )
  68. {
  69. if(components != null)
  70. {
  71. components.Dispose();
  72. }
  73. }
  74. base.Dispose( disposing );
  75. }
  76. #region Windows Form Designer generated code
  77. /// <summary>
  78. /// Required method for Designer support - do not modify
  79. /// the contents of this method with the code editor.
  80. /// </summary>
  81. private void InitializeComponent()
  82. {
  83. System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("Allowed");
  84. System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem("DAO");
  85. System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem("Read CD Text");
  86. System.Windows.Forms.ListViewItem listViewItem4 = new System.Windows.Forms.ListViewItem("Variable Pauses in TAO");
  87. System.Windows.Forms.ListViewItem listViewItem5 = new System.Windows.Forms.ListViewItem("DAO Write CD Text");
  88. System.Windows.Forms.ListViewItem listViewItem6 = new System.Windows.Forms.ListViewItem("Image Recorder");
  89. System.Windows.Forms.ListViewItem listViewItem7 = new System.Windows.Forms.ListViewItem("Undetected");
  90. System.Windows.Forms.ListViewItem listViewItem8 = new System.Windows.Forms.ListViewItem("IDE Bus");
  91. System.Windows.Forms.ListViewItem listViewItem9 = new System.Windows.Forms.ListViewItem("SCSI Bus");
  92. System.Windows.Forms.ListViewItem listViewItem10 = new System.Windows.Forms.ListViewItem("Buffer Underrun Protection");
  93. System.Windows.Forms.ListViewItem listViewItem11 = new System.Windows.Forms.ListViewItem("Allow Change Booktype");
  94. System.Windows.Forms.ListViewItem listViewItem12 = new System.Windows.Forms.ListViewItem("DVDPLUSVR Supported");
  95. System.Windows.Forms.ListViewItem listViewItem13 = new System.Windows.Forms.ListViewItem("Duallayer DVD Supported");
  96. System.Windows.Forms.ListViewItem listViewItem14 = new System.Windows.Forms.ListViewItem("eNoWriting");
  97. System.Windows.Forms.ListViewItem listViewItem15 = new System.Windows.Forms.ListViewItem("ePacketWriting");
  98. System.Windows.Forms.ListViewItem listViewItem16 = new System.Windows.Forms.ListViewItem("eManagedMRW");
  99. System.Windows.Forms.ListViewItem listViewItem17 = new System.Windows.Forms.ListViewItem("eRawMRW");
  100. this.c_Close = new System.Windows.Forms.Button();
  101. this.label1 = new System.Windows.Forms.Label();
  102. this.c_HostAdapterName = new System.Windows.Forms.TextBox();
  103. this.c_HostAdapterNumber = new System.Windows.Forms.TextBox();
  104. this.label2 = new System.Windows.Forms.Label();
  105. this.c_DeviceID = new System.Windows.Forms.TextBox();
  106. this.label3 = new System.Windows.Forms.Label();
  107. this.c_DeviceType = new System.Windows.Forms.TextBox();
  108. this.label4 = new System.Windows.Forms.Label();
  109. this.c_DriveLetter = new System.Windows.Forms.TextBox();
  110. this.label5 = new System.Windows.Forms.Label();
  111. this.label6 = new System.Windows.Forms.Label();
  112. this.c_Capabilities = new System.Windows.Forms.ListView();
  113. this.label7 = new System.Windows.Forms.Label();
  114. this.c_BufUnderrunProt = new System.Windows.Forms.TextBox();
  115. this.label8 = new System.Windows.Forms.Label();
  116. this.c_MediaSupport = new System.Windows.Forms.TextBox();
  117. this.label9 = new System.Windows.Forms.Label();
  118. this.c_MediaReadSupport = new System.Windows.Forms.TextBox();
  119. this.label10 = new System.Windows.Forms.Label();
  120. this.c_MandatoryBUPSpeed = new System.Windows.Forms.TextBox();
  121. this.c_SupportedAccessModes = new System.Windows.Forms.ListView();
  122. this.label11 = new System.Windows.Forms.Label();
  123. this.groupBox1 = new System.Windows.Forms.GroupBox();
  124. this.c_ChooseMedia = new System.Windows.Forms.Button();
  125. this.label12 = new System.Windows.Forms.Label();
  126. this.label13 = new System.Windows.Forms.Label();
  127. this.c_ReadSpeeds = new LYFZ.NeroDiscBurn.NET.SpeedComboBox();
  128. this.c_WriteSpeeds = new LYFZ.NeroDiscBurn.NET.SpeedComboBox();
  129. this.groupBox1.SuspendLayout();
  130. this.SuspendLayout();
  131. //
  132. // c_Close
  133. //
  134. this.c_Close.DialogResult = System.Windows.Forms.DialogResult.Cancel;
  135. this.c_Close.Location = new System.Drawing.Point(384, 362);
  136. this.c_Close.Name = "c_Close";
  137. this.c_Close.Size = new System.Drawing.Size(90, 25);
  138. this.c_Close.TabIndex = 23;
  139. this.c_Close.Text = "Close";
  140. //
  141. // label1
  142. //
  143. this.label1.Location = new System.Drawing.Point(10, 9);
  144. this.label1.Name = "label1";
  145. this.label1.Size = new System.Drawing.Size(134, 17);
  146. this.label1.TabIndex = 0;
  147. this.label1.Text = "Host Adapter Name:";
  148. //
  149. // c_HostAdapterName
  150. //
  151. this.c_HostAdapterName.Location = new System.Drawing.Point(10, 26);
  152. this.c_HostAdapterName.Name = "c_HostAdapterName";
  153. this.c_HostAdapterName.ReadOnly = true;
  154. this.c_HostAdapterName.Size = new System.Drawing.Size(124, 21);
  155. this.c_HostAdapterName.TabIndex = 1;
  156. //
  157. // c_HostAdapterNumber
  158. //
  159. this.c_HostAdapterNumber.Location = new System.Drawing.Point(10, 69);
  160. this.c_HostAdapterNumber.Name = "c_HostAdapterNumber";
  161. this.c_HostAdapterNumber.ReadOnly = true;
  162. this.c_HostAdapterNumber.Size = new System.Drawing.Size(57, 21);
  163. this.c_HostAdapterNumber.TabIndex = 9;
  164. //
  165. // label2
  166. //
  167. this.label2.Location = new System.Drawing.Point(10, 52);
  168. this.label2.Name = "label2";
  169. this.label2.Size = new System.Drawing.Size(144, 17);
  170. this.label2.TabIndex = 8;
  171. this.label2.Text = "Host Adapter Number:";
  172. //
  173. // c_DeviceID
  174. //
  175. this.c_DeviceID.Location = new System.Drawing.Point(154, 26);
  176. this.c_DeviceID.Name = "c_DeviceID";
  177. this.c_DeviceID.ReadOnly = true;
  178. this.c_DeviceID.Size = new System.Drawing.Size(48, 21);
  179. this.c_DeviceID.TabIndex = 3;
  180. //
  181. // label3
  182. //
  183. this.label3.Location = new System.Drawing.Point(154, 9);
  184. this.label3.Name = "label3";
  185. this.label3.Size = new System.Drawing.Size(67, 17);
  186. this.label3.TabIndex = 2;
  187. this.label3.Text = "Device ID:";
  188. //
  189. // c_DeviceType
  190. //
  191. this.c_DeviceType.Location = new System.Drawing.Point(154, 69);
  192. this.c_DeviceType.Name = "c_DeviceType";
  193. this.c_DeviceType.ReadOnly = true;
  194. this.c_DeviceType.Size = new System.Drawing.Size(144, 21);
  195. this.c_DeviceType.TabIndex = 11;
  196. //
  197. // label4
  198. //
  199. this.label4.Location = new System.Drawing.Point(154, 52);
  200. this.label4.Name = "label4";
  201. this.label4.Size = new System.Drawing.Size(86, 17);
  202. this.label4.TabIndex = 10;
  203. this.label4.Text = "Device Type:";
  204. //
  205. // c_DriveLetter
  206. //
  207. this.c_DriveLetter.Location = new System.Drawing.Point(240, 26);
  208. this.c_DriveLetter.Name = "c_DriveLetter";
  209. this.c_DriveLetter.ReadOnly = true;
  210. this.c_DriveLetter.Size = new System.Drawing.Size(48, 21);
  211. this.c_DriveLetter.TabIndex = 5;
  212. //
  213. // label5
  214. //
  215. this.label5.Location = new System.Drawing.Point(240, 9);
  216. this.label5.Name = "label5";
  217. this.label5.Size = new System.Drawing.Size(86, 17);
  218. this.label5.TabIndex = 4;
  219. this.label5.Text = "Drive Letter:";
  220. //
  221. // label6
  222. //
  223. this.label6.Location = new System.Drawing.Point(10, 95);
  224. this.label6.Name = "label6";
  225. this.label6.Size = new System.Drawing.Size(105, 17);
  226. this.label6.TabIndex = 14;
  227. this.label6.Text = "Capabilities:";
  228. //
  229. // c_Capabilities
  230. //
  231. this.c_Capabilities.CheckBoxes = true;
  232. listViewItem1.StateImageIndex = 0;
  233. listViewItem1.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_ALLOWED;
  234. listViewItem2.StateImageIndex = 0;
  235. listViewItem2.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_DAO;
  236. listViewItem3.StateImageIndex = 0;
  237. listViewItem3.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_READ_CD_TEXT;
  238. listViewItem4.StateImageIndex = 0;
  239. listViewItem4.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_VARIABLE_PAUSES_IN_TAO;
  240. listViewItem5.StateImageIndex = 0;
  241. listViewItem5.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_DAO_WRITE_CD_TEXT;
  242. listViewItem6.StateImageIndex = 0;
  243. listViewItem6.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_IMAGE_RECORDER;
  244. listViewItem7.StateImageIndex = 0;
  245. listViewItem7.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_UNDETECTED;
  246. listViewItem8.StateImageIndex = 0;
  247. listViewItem8.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_IDE_BUS;
  248. listViewItem9.StateImageIndex = 0;
  249. listViewItem9.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_SCSI_BUS;
  250. listViewItem10.StateImageIndex = 0;
  251. listViewItem10.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_BUF_UNDERRUN_PROT;
  252. listViewItem11.StateImageIndex = 0;
  253. listViewItem11.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_ALLOW_CHANGE_BOOKTYPE;
  254. listViewItem12.StateImageIndex = 0;
  255. listViewItem12.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_DVDPLUSVR_SUPPORTED;
  256. listViewItem13.StateImageIndex = 0;
  257. listViewItem13.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_DUALLAYER_DVD_SUPPORTED;
  258. this.c_Capabilities.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
  259. listViewItem1,
  260. listViewItem2,
  261. listViewItem3,
  262. listViewItem4,
  263. listViewItem5,
  264. listViewItem6,
  265. listViewItem7,
  266. listViewItem8,
  267. listViewItem9,
  268. listViewItem10,
  269. listViewItem11,
  270. listViewItem12,
  271. listViewItem13});
  272. this.c_Capabilities.Location = new System.Drawing.Point(10, 112);
  273. this.c_Capabilities.Name = "c_Capabilities";
  274. this.c_Capabilities.Size = new System.Drawing.Size(230, 164);
  275. this.c_Capabilities.TabIndex = 15;
  276. this.c_Capabilities.UseCompatibleStateImageBehavior = false;
  277. this.c_Capabilities.View = System.Windows.Forms.View.List;
  278. //
  279. // label7
  280. //
  281. this.label7.Location = new System.Drawing.Point(326, 9);
  282. this.label7.Name = "label7";
  283. this.label7.Size = new System.Drawing.Size(144, 17);
  284. this.label7.TabIndex = 6;
  285. this.label7.Text = "Buffer Underrun Prot:";
  286. //
  287. // c_BufUnderrunProt
  288. //
  289. this.c_BufUnderrunProt.Location = new System.Drawing.Point(326, 26);
  290. this.c_BufUnderrunProt.Name = "c_BufUnderrunProt";
  291. this.c_BufUnderrunProt.ReadOnly = true;
  292. this.c_BufUnderrunProt.Size = new System.Drawing.Size(144, 21);
  293. this.c_BufUnderrunProt.TabIndex = 7;
  294. //
  295. // label8
  296. //
  297. this.label8.Location = new System.Drawing.Point(19, 293);
  298. this.label8.Name = "label8";
  299. this.label8.Size = new System.Drawing.Size(106, 17);
  300. this.label8.TabIndex = 21;
  301. this.label8.Text = "媒体支持:";
  302. //
  303. // c_MediaSupport
  304. //
  305. this.c_MediaSupport.Location = new System.Drawing.Point(19, 310);
  306. this.c_MediaSupport.Name = "c_MediaSupport";
  307. this.c_MediaSupport.ReadOnly = true;
  308. this.c_MediaSupport.Size = new System.Drawing.Size(346, 21);
  309. this.c_MediaSupport.TabIndex = 22;
  310. //
  311. // label9
  312. //
  313. this.label9.Location = new System.Drawing.Point(250, 112);
  314. this.label9.Name = "label9";
  315. this.label9.Size = new System.Drawing.Size(144, 17);
  316. this.label9.TabIndex = 16;
  317. this.label9.Text = "媒体阅读支持:";
  318. //
  319. // c_MediaReadSupport
  320. //
  321. this.c_MediaReadSupport.Location = new System.Drawing.Point(250, 129);
  322. this.c_MediaReadSupport.Name = "c_MediaReadSupport";
  323. this.c_MediaReadSupport.ReadOnly = true;
  324. this.c_MediaReadSupport.Size = new System.Drawing.Size(220, 21);
  325. this.c_MediaReadSupport.TabIndex = 17;
  326. //
  327. // label10
  328. //
  329. this.label10.Location = new System.Drawing.Point(326, 52);
  330. this.label10.Name = "label10";
  331. this.label10.Size = new System.Drawing.Size(154, 17);
  332. this.label10.TabIndex = 12;
  333. this.label10.Text = "Mandatory BUP Speed:";
  334. //
  335. // c_MandatoryBUPSpeed
  336. //
  337. this.c_MandatoryBUPSpeed.Location = new System.Drawing.Point(326, 69);
  338. this.c_MandatoryBUPSpeed.Name = "c_MandatoryBUPSpeed";
  339. this.c_MandatoryBUPSpeed.ReadOnly = true;
  340. this.c_MandatoryBUPSpeed.Size = new System.Drawing.Size(144, 21);
  341. this.c_MandatoryBUPSpeed.TabIndex = 13;
  342. //
  343. // c_SupportedAccessModes
  344. //
  345. this.c_SupportedAccessModes.CheckBoxes = true;
  346. listViewItem14.StateImageIndex = 0;
  347. listViewItem14.Tag = NEROLib.AccessMode.eNoWriting;
  348. listViewItem15.StateImageIndex = 0;
  349. listViewItem15.Tag = NEROLib.AccessMode.ePacketWriting;
  350. listViewItem16.StateImageIndex = 0;
  351. listViewItem16.Tag = NEROLib.AccessMode.eManagedMRW;
  352. listViewItem17.StateImageIndex = 0;
  353. listViewItem17.Tag = NEROLib.AccessMode.eRawMRW;
  354. this.c_SupportedAccessModes.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
  355. listViewItem14,
  356. listViewItem15,
  357. listViewItem16,
  358. listViewItem17});
  359. this.c_SupportedAccessModes.Location = new System.Drawing.Point(250, 172);
  360. this.c_SupportedAccessModes.Name = "c_SupportedAccessModes";
  361. this.c_SupportedAccessModes.Size = new System.Drawing.Size(144, 104);
  362. this.c_SupportedAccessModes.TabIndex = 19;
  363. this.c_SupportedAccessModes.UseCompatibleStateImageBehavior = false;
  364. this.c_SupportedAccessModes.View = System.Windows.Forms.View.List;
  365. //
  366. // label11
  367. //
  368. this.label11.Location = new System.Drawing.Point(250, 155);
  369. this.label11.Name = "label11";
  370. this.label11.Size = new System.Drawing.Size(163, 17);
  371. this.label11.TabIndex = 18;
  372. this.label11.Text = "支持的接入方式:";
  373. //
  374. // groupBox1
  375. //
  376. this.groupBox1.Controls.Add(this.c_ChooseMedia);
  377. this.groupBox1.Controls.Add(this.c_ReadSpeeds);
  378. this.groupBox1.Controls.Add(this.c_WriteSpeeds);
  379. this.groupBox1.Controls.Add(this.label12);
  380. this.groupBox1.Controls.Add(this.label13);
  381. this.groupBox1.Location = new System.Drawing.Point(10, 276);
  382. this.groupBox1.Name = "groupBox1";
  383. this.groupBox1.Size = new System.Drawing.Size(364, 112);
  384. this.groupBox1.TabIndex = 20;
  385. this.groupBox1.TabStop = false;
  386. //
  387. // c_ChooseMedia
  388. //
  389. this.c_ChooseMedia.Location = new System.Drawing.Point(240, 78);
  390. this.c_ChooseMedia.Name = "c_ChooseMedia";
  391. this.c_ChooseMedia.Size = new System.Drawing.Size(115, 24);
  392. this.c_ChooseMedia.TabIndex = 4;
  393. this.c_ChooseMedia.Text = "Choose Media";
  394. this.c_ChooseMedia.Click += new System.EventHandler(this.c_ChooseMedia_Click);
  395. //
  396. // label12
  397. //
  398. this.label12.Location = new System.Drawing.Point(10, 60);
  399. this.label12.Name = "label12";
  400. this.label12.Size = new System.Drawing.Size(105, 18);
  401. this.label12.TabIndex = 0;
  402. this.label12.Text = "Read Speeds:";
  403. //
  404. // label13
  405. //
  406. this.label13.Location = new System.Drawing.Point(125, 60);
  407. this.label13.Name = "label13";
  408. this.label13.Size = new System.Drawing.Size(96, 18);
  409. this.label13.TabIndex = 2;
  410. this.label13.Text = "Write Speeds:";
  411. //
  412. // c_ReadSpeeds
  413. //
  414. this.c_ReadSpeeds.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  415. this.c_ReadSpeeds.Location = new System.Drawing.Point(10, 78);
  416. this.c_ReadSpeeds.Name = "c_ReadSpeeds";
  417. this.c_ReadSpeeds.Size = new System.Drawing.Size(105, 20);
  418. this.c_ReadSpeeds.TabIndex = 1;
  419. //
  420. // c_WriteSpeeds
  421. //
  422. this.c_WriteSpeeds.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  423. this.c_WriteSpeeds.Location = new System.Drawing.Point(125, 78);
  424. this.c_WriteSpeeds.Name = "c_WriteSpeeds";
  425. this.c_WriteSpeeds.Size = new System.Drawing.Size(105, 20);
  426. this.c_WriteSpeeds.TabIndex = 3;
  427. //
  428. // DriveInfoForm
  429. //
  430. this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
  431. this.CancelButton = this.c_Close;
  432. this.ClientSize = new System.Drawing.Size(517, 423);
  433. this.Controls.Add(this.c_SupportedAccessModes);
  434. this.Controls.Add(this.c_Capabilities);
  435. this.Controls.Add(this.c_HostAdapterName);
  436. this.Controls.Add(this.c_HostAdapterNumber);
  437. this.Controls.Add(this.c_DeviceID);
  438. this.Controls.Add(this.c_DeviceType);
  439. this.Controls.Add(this.c_DriveLetter);
  440. this.Controls.Add(this.c_BufUnderrunProt);
  441. this.Controls.Add(this.c_MediaSupport);
  442. this.Controls.Add(this.c_MediaReadSupport);
  443. this.Controls.Add(this.c_MandatoryBUPSpeed);
  444. this.Controls.Add(this.label1);
  445. this.Controls.Add(this.c_Close);
  446. this.Controls.Add(this.label2);
  447. this.Controls.Add(this.label3);
  448. this.Controls.Add(this.label4);
  449. this.Controls.Add(this.label5);
  450. this.Controls.Add(this.label6);
  451. this.Controls.Add(this.label7);
  452. this.Controls.Add(this.label8);
  453. this.Controls.Add(this.label9);
  454. this.Controls.Add(this.label10);
  455. this.Controls.Add(this.label11);
  456. this.Controls.Add(this.groupBox1);
  457. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  458. this.MaximizeBox = false;
  459. this.MinimizeBox = false;
  460. this.Name = "DriveInfoForm";
  461. this.ShowInTaskbar = false;
  462. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
  463. this.Text = "DriveInfo";
  464. this.groupBox1.ResumeLayout(false);
  465. this.ResumeLayout(false);
  466. this.PerformLayout();
  467. }
  468. #endregion
  469. protected override void OnLoad(EventArgs e)
  470. {
  471. base.OnLoad (e);
  472. // On form load fill all the controls with the information
  473. // about the drive.
  474. //
  475. c_DeviceID.Text = m_drive.DeviceID.ToString ();
  476. switch (m_drive.DevType)
  477. {
  478. case NERO_SCSI_DEVTYPE.NERO_SCSI_DEVTYPE_WORM:
  479. c_DeviceType.Text = "Worm";
  480. break;
  481. case NERO_SCSI_DEVTYPE.NERO_SCSI_DEVTYPE_CDROM:
  482. c_DeviceType.Text = "CDROM";
  483. break;
  484. case NERO_SCSI_DEVTYPE.NERO_SCSI_DEVTYPE_UNSUPPORTED_WORM:
  485. c_DeviceType.Text = "Unsupported Worm";
  486. break;
  487. default:
  488. c_DeviceType.Text = "Unknown";
  489. break;
  490. }
  491. c_DriveLetter.Text = m_drive.DriveLetter.ToUpper ().ToString ();
  492. c_HostAdapterName.Text = m_drive.HostAdapterName;
  493. c_HostAdapterNumber.Text = m_drive.HostAdapterNo.ToString ();
  494. c_MandatoryBUPSpeed.Text = m_drive.MandatoryBUPSpeed.ToString ();
  495. // Fill in the capabilities list view.
  496. //
  497. foreach (ListViewItem lvi in c_Capabilities.Items)
  498. {
  499. lvi.Checked = 0 != (m_drive.Capabilities & (NERO_CAPABILITIES) lvi.Tag);
  500. }
  501. c_BufUnderrunProt.Text = m_drive.BufUnderrunProtName;
  502. c_MediaSupport.Text = m_nero.get_TypeNameOfMedia ((NERO_MEDIA_TYPE) m_drive.MediaSupport);
  503. c_MediaReadSupport.Text = m_nero.get_TypeNameOfMedia (m_drive.MediaReadSupport);
  504. // Fill in the supported access modes list view.
  505. //
  506. foreach (ListViewItem lvi in c_SupportedAccessModes.Items)
  507. {
  508. lvi.Checked = 0 != (m_drive.SupportedAccessModes & (int) (AccessMode) lvi.Tag);
  509. }
  510. UpdateSpeeds ();
  511. }
  512. private void UpdateSpeeds ()
  513. {
  514. // Update the read and write speeds. These are dependant on the
  515. // chosen media.
  516. //
  517. c_ReadSpeeds.Populate (m_drive.get_AvailableSpeeds (NERO_ACCESSTYPE.NERO_ACCESSTYPE_READ, m_frmChooseMedia.GetMediaType ()));
  518. c_WriteSpeeds.Populate (m_drive.get_AvailableSpeeds (NERO_ACCESSTYPE.NERO_ACCESSTYPE_WRITE, m_frmChooseMedia.GetMediaType ()));
  519. }
  520. private void c_ChooseMedia_Click(object sender, System.EventArgs e)
  521. {
  522. if (DialogResult.OK == m_frmChooseMedia.ShowDialog (this))
  523. {
  524. UpdateSpeeds ();
  525. }
  526. }
  527. }
  528. }