ChooseBurnFlags.cs 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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 ChooseBurnFlagsForm.
  11. /// </summary>
  12. public class ChooseBurnFlagsForm : System.Windows.Forms.Form
  13. {
  14. private System.Windows.Forms.Button c_OK;
  15. private System.Windows.Forms.Button c_Cancel;
  16. private System.Windows.Forms.Label label9;
  17. private System.Windows.Forms.ListView c_BurnFlags;
  18. /// <summary>
  19. /// Required designer variable.
  20. /// </summary>
  21. private System.ComponentModel.Container components = null;
  22. public ChooseBurnFlagsForm()
  23. {
  24. //
  25. // Required for Windows Form Designer support
  26. //
  27. InitializeComponent();
  28. }
  29. /// <summary>
  30. /// Clean up any resources being used.
  31. /// </summary>
  32. protected override void Dispose( bool disposing )
  33. {
  34. if( disposing )
  35. {
  36. if(components != null)
  37. {
  38. components.Dispose();
  39. }
  40. }
  41. base.Dispose( disposing );
  42. }
  43. #region Windows Form Designer generated code
  44. /// <summary>
  45. /// Required method for Designer support - do not modify
  46. /// the contents of this method with the code editor.
  47. /// </summary>
  48. private void InitializeComponent()
  49. {
  50. System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("速度测试");
  51. System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem("模拟");
  52. System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem("写");
  53. System.Windows.Forms.ListViewItem listViewItem4 = new System.Windows.Forms.ListViewItem("DAO");
  54. System.Windows.Forms.ListViewItem listViewItem5 = new System.Windows.Forms.ListViewItem("关闭会话");
  55. System.Windows.Forms.ListViewItem listViewItem6 = new System.Windows.Forms.ListViewItem("CD Text");
  56. System.Windows.Forms.ListViewItem listViewItem7 = new System.Windows.Forms.ListViewItem("缓冲区数据不足保护");
  57. System.Windows.Forms.ListViewItem listViewItem8 = new System.Windows.Forms.ListViewItem("禁用中止");
  58. System.Windows.Forms.ListViewItem listViewItem9 = new System.Windows.Forms.ListViewItem("检测非空的可擦写");
  59. System.Windows.Forms.ListViewItem listViewItem10 = new System.Windows.Forms.ListViewItem("禁止弹出");
  60. System.Windows.Forms.ListViewItem listViewItem11 = new System.Windows.Forms.ListViewItem("校验");
  61. System.Windows.Forms.ListViewItem listViewItem12 = new System.Windows.Forms.ListViewItem("DVD+刻录30毫米至少");
  62. System.Windows.Forms.ListViewItem listViewItem13 = new System.Windows.Forms.ListViewItem("CD 日文");
  63. System.Windows.Forms.ListViewItem listViewItem14 = new System.Windows.Forms.ListViewItem("Booktype DVDROM");
  64. System.Windows.Forms.ListViewItem listViewItem15 = new System.Windows.Forms.ListViewItem("No Booktype Change");
  65. this.c_OK = new System.Windows.Forms.Button();
  66. this.c_Cancel = new System.Windows.Forms.Button();
  67. this.label9 = new System.Windows.Forms.Label();
  68. this.c_BurnFlags = new System.Windows.Forms.ListView();
  69. this.SuspendLayout();
  70. //
  71. // c_OK
  72. //
  73. this.c_OK.DialogResult = System.Windows.Forms.DialogResult.OK;
  74. this.c_OK.Location = new System.Drawing.Point(268, 139);
  75. this.c_OK.Name = "c_OK";
  76. this.c_OK.Size = new System.Drawing.Size(90, 24);
  77. this.c_OK.TabIndex = 2;
  78. this.c_OK.Text = "确定";
  79. //
  80. // c_Cancel
  81. //
  82. this.c_Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
  83. this.c_Cancel.Location = new System.Drawing.Point(387, 139);
  84. this.c_Cancel.Name = "c_Cancel";
  85. this.c_Cancel.Size = new System.Drawing.Size(90, 25);
  86. this.c_Cancel.TabIndex = 3;
  87. this.c_Cancel.Text = "取消";
  88. //
  89. // label9
  90. //
  91. this.label9.Location = new System.Drawing.Point(10, 9);
  92. this.label9.Name = "label9";
  93. this.label9.Size = new System.Drawing.Size(120, 17);
  94. this.label9.TabIndex = 0;
  95. this.label9.Text = "刻录标志:";
  96. //
  97. // c_BurnFlags
  98. //
  99. this.c_BurnFlags.CheckBoxes = true;
  100. this.c_BurnFlags.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
  101. this.c_BurnFlags.HideSelection = false;
  102. listViewItem1.StateImageIndex = 0;
  103. listViewItem1.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_SPEED_TEST;
  104. listViewItem2.StateImageIndex = 0;
  105. listViewItem2.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_SIMULATE;
  106. listViewItem3.Checked = true;
  107. listViewItem3.StateImageIndex = 1;
  108. listViewItem3.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_WRITE;
  109. listViewItem4.Checked = true;
  110. listViewItem4.StateImageIndex = 1;
  111. listViewItem4.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_DAO;
  112. listViewItem5.Checked = true;
  113. listViewItem5.StateImageIndex = 1;
  114. listViewItem5.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_CLOSE_SESSION;
  115. listViewItem6.Checked = true;
  116. listViewItem6.StateImageIndex = 1;
  117. listViewItem6.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_CD_TEXT;
  118. listViewItem7.Checked = true;
  119. listViewItem7.StateImageIndex = 1;
  120. listViewItem7.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_BUF_UNDERRUN_PROT;
  121. listViewItem8.Checked = true;
  122. listViewItem8.StateImageIndex = 1;
  123. listViewItem8.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_DISABLE_ABORT;
  124. listViewItem9.Checked = true;
  125. listViewItem9.StateImageIndex = 1;
  126. listViewItem9.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_DETECT_NON_EMPTY_CDRW;
  127. listViewItem10.StateImageIndex = 0;
  128. listViewItem10.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_DISABLE_EJECT;
  129. listViewItem11.StateImageIndex = 0;
  130. listViewItem11.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_VERIFY;
  131. listViewItem12.StateImageIndex = 0;
  132. listViewItem12.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_DVDP_BURN_30MM_AT_LEAST;
  133. listViewItem13.StateImageIndex = 0;
  134. listViewItem13.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_CD_TEXT_IS_JAPANESE;
  135. listViewItem14.StateImageIndex = 0;
  136. listViewItem14.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_BOOKTYPE_DVDROM;
  137. listViewItem15.StateImageIndex = 0;
  138. listViewItem15.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_NO_BOOKTYPE_CHANGE;
  139. this.c_BurnFlags.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
  140. listViewItem1,
  141. listViewItem2,
  142. listViewItem3,
  143. listViewItem4,
  144. listViewItem5,
  145. listViewItem6,
  146. listViewItem7,
  147. listViewItem8,
  148. listViewItem9,
  149. listViewItem10,
  150. listViewItem11,
  151. listViewItem12,
  152. listViewItem13,
  153. listViewItem14,
  154. listViewItem15});
  155. this.c_BurnFlags.Location = new System.Drawing.Point(10, 26);
  156. this.c_BurnFlags.Name = "c_BurnFlags";
  157. this.c_BurnFlags.Size = new System.Drawing.Size(475, 99);
  158. this.c_BurnFlags.TabIndex = 1;
  159. this.c_BurnFlags.UseCompatibleStateImageBehavior = false;
  160. this.c_BurnFlags.View = System.Windows.Forms.View.List;
  161. //
  162. // ChooseBurnFlagsForm
  163. //
  164. this.AcceptButton = this.c_OK;
  165. this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
  166. this.CancelButton = this.c_Cancel;
  167. this.ClientSize = new System.Drawing.Size(497, 179);
  168. this.Controls.Add(this.label9);
  169. this.Controls.Add(this.c_BurnFlags);
  170. this.Controls.Add(this.c_OK);
  171. this.Controls.Add(this.c_Cancel);
  172. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  173. this.MaximizeBox = false;
  174. this.MinimizeBox = false;
  175. this.Name = "ChooseBurnFlagsForm";
  176. this.ShowInTaskbar = false;
  177. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
  178. this.Text = "选择刻录标志";
  179. this.ResumeLayout(false);
  180. }
  181. #endregion
  182. // This is a public function that tells the caller
  183. // state of the selected burn flags at any time.
  184. //
  185. public NERO_BURN_FLAGS GetBurnFlags ()
  186. {
  187. // Burn flags are just flags so use uint until
  188. // we collect all flags. Then cast it back to
  189. // NERO_BURN_FLAGS.
  190. //
  191. uint bf = 0;
  192. foreach (ListViewItem lvi in c_BurnFlags.Items)
  193. {
  194. if (lvi.Checked)
  195. {
  196. bf |= (uint) (NERO_BURN_FLAGS) lvi.Tag;
  197. }
  198. }
  199. return (NERO_BURN_FLAGS) bf;
  200. }
  201. // Return a textual representation of the set of
  202. // burn flags.
  203. //
  204. public new string ToString ()
  205. {
  206. string s = "";
  207. foreach (ListViewItem lvi in c_BurnFlags.Items)
  208. {
  209. if (lvi.Checked)
  210. {
  211. if (s != "")
  212. {
  213. s += " + ";
  214. }
  215. s += lvi.Text;
  216. }
  217. }
  218. return s;
  219. }
  220. }
  221. }