123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336 |
- using System;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
- using NEROLib;
- namespace LYFZ.NeroDiscBurn.NET
- {
- /// <summary>
- /// Summary description for ChooseMedia.
- /// </summary>
- public class ChooseMediaForm : System.Windows.Forms.Form
- {
- private Nero m_nero;
- private System.Windows.Forms.Button c_OK;
- private System.Windows.Forms.Button c_Cancel;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.ListView c_Media;
- private RadioButton radioButtonCD;
- private RadioButton radioButtonDVD;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.Container components = null;
- public ChooseMediaForm(Nero nero)
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
- this.Shown += ChooseMediaForm_Shown;
- m_nero = nero;
- }
- void ChooseMediaForm_Shown(object sender, EventArgs e)
- {
- if (this.CMediaType == "cd")
- {
- this.radioButtonCD.Checked = true;
- }
- else if (this.CMediaType == "dvd")
- {
- this.radioButtonDVD.Checked = true;
- }
- }
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- System.Windows.Forms.ListViewItem listViewItem20 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_CD");
- System.Windows.Forms.ListViewItem listViewItem21 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_DDCD");
- System.Windows.Forms.ListViewItem listViewItem22 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_DVD_M");
- System.Windows.Forms.ListViewItem listViewItem23 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_DVD_P");
- System.Windows.Forms.ListViewItem listViewItem24 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_DVD_RAM");
- System.Windows.Forms.ListViewItem listViewItem25 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_ML");
- System.Windows.Forms.ListViewItem listViewItem26 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_MRW");
- System.Windows.Forms.ListViewItem listViewItem27 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_NO_CDR");
- System.Windows.Forms.ListViewItem listViewItem28 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_NO_CDRW");
- System.Windows.Forms.ListViewItem listViewItem29 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_DVD_ROM");
- System.Windows.Forms.ListViewItem listViewItem30 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_CDROM");
- System.Windows.Forms.ListViewItem listViewItem31 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_NO_DVD_M_RW");
- System.Windows.Forms.ListViewItem listViewItem32 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_NO_DVD_M_R");
- System.Windows.Forms.ListViewItem listViewItem33 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_NO_DVD_P_RW");
- System.Windows.Forms.ListViewItem listViewItem34 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_NO_DVD_P_R");
- System.Windows.Forms.ListViewItem listViewItem35 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_FPACKET");
- System.Windows.Forms.ListViewItem listViewItem36 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_VPACKET");
- System.Windows.Forms.ListViewItem listViewItem37 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_HDB");
- System.Windows.Forms.ListViewItem listViewItem38 = new System.Windows.Forms.ListViewItem("NERO_MEDIA_DVD_P_R9");
- this.c_OK = new System.Windows.Forms.Button();
- this.c_Cancel = new System.Windows.Forms.Button();
- this.c_Media = new System.Windows.Forms.ListView();
- this.label1 = new System.Windows.Forms.Label();
- this.radioButtonCD = new System.Windows.Forms.RadioButton();
- this.radioButtonDVD = new System.Windows.Forms.RadioButton();
- this.SuspendLayout();
- //
- // c_OK
- //
- this.c_OK.DialogResult = System.Windows.Forms.DialogResult.OK;
- this.c_OK.Location = new System.Drawing.Point(317, 171);
- this.c_OK.Name = "c_OK";
- this.c_OK.Size = new System.Drawing.Size(90, 25);
- this.c_OK.TabIndex = 2;
- this.c_OK.Text = "È· ¶¨";
- //
- // c_Cancel
- //
- this.c_Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.c_Cancel.Location = new System.Drawing.Point(429, 171);
- this.c_Cancel.Name = "c_Cancel";
- this.c_Cancel.Size = new System.Drawing.Size(90, 25);
- this.c_Cancel.TabIndex = 3;
- this.c_Cancel.Text = "Ïû È¡";
- //
- // c_Media
- //
- this.c_Media.CheckBoxes = true;
- this.c_Media.HideSelection = false;
- listViewItem20.Checked = true;
- listViewItem20.StateImageIndex = 1;
- listViewItem20.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_CD;
- listViewItem21.Checked = true;
- listViewItem21.StateImageIndex = 1;
- listViewItem21.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_DDCD;
- listViewItem22.Checked = true;
- listViewItem22.StateImageIndex = 1;
- listViewItem22.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_DVD_M;
- listViewItem23.Checked = true;
- listViewItem23.StateImageIndex = 1;
- listViewItem23.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_DVD_P;
- listViewItem24.Checked = true;
- listViewItem24.StateImageIndex = 1;
- listViewItem24.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_DVD_RAM;
- listViewItem25.Checked = true;
- listViewItem25.StateImageIndex = 1;
- listViewItem25.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_ML;
- listViewItem26.Checked = true;
- listViewItem26.StateImageIndex = 1;
- listViewItem26.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_MRW;
- listViewItem27.Checked = true;
- listViewItem27.StateImageIndex = 1;
- listViewItem27.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_NO_CDR;
- listViewItem28.Checked = true;
- listViewItem28.StateImageIndex = 1;
- listViewItem28.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_NO_CDRW;
- listViewItem29.Checked = true;
- listViewItem29.StateImageIndex = 1;
- listViewItem29.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_DVD_ROM;
- listViewItem30.Checked = true;
- listViewItem30.StateImageIndex = 1;
- listViewItem30.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_CDROM;
- listViewItem31.Checked = true;
- listViewItem31.StateImageIndex = 1;
- listViewItem31.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_NO_DVD_M_RW;
- listViewItem32.Checked = true;
- listViewItem32.StateImageIndex = 1;
- listViewItem32.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_NO_DVD_M_R;
- listViewItem33.Checked = true;
- listViewItem33.StateImageIndex = 1;
- listViewItem33.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_NO_DVD_P_RW;
- listViewItem34.Checked = true;
- listViewItem34.StateImageIndex = 1;
- listViewItem34.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_NO_DVD_P_R;
- listViewItem35.Checked = true;
- listViewItem35.StateImageIndex = 1;
- listViewItem35.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_FPACKET;
- listViewItem36.Checked = true;
- listViewItem36.StateImageIndex = 1;
- listViewItem36.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_VPACKET;
- listViewItem37.Checked = true;
- listViewItem37.StateImageIndex = 1;
- listViewItem37.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_HDB;
- listViewItem38.Checked = true;
- listViewItem38.StateImageIndex = 1;
- listViewItem38.Tag = NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_DVD_P_R9;
- this.c_Media.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
- listViewItem20,
- listViewItem21,
- listViewItem22,
- listViewItem23,
- listViewItem24,
- listViewItem25,
- listViewItem26,
- listViewItem27,
- listViewItem28,
- listViewItem29,
- listViewItem30,
- listViewItem31,
- listViewItem32,
- listViewItem33,
- listViewItem34,
- listViewItem35,
- listViewItem36,
- listViewItem37,
- listViewItem38});
- this.c_Media.Location = new System.Drawing.Point(10, 46);
- this.c_Media.Name = "c_Media";
- this.c_Media.Size = new System.Drawing.Size(511, 120);
- this.c_Media.TabIndex = 1;
- this.c_Media.UseCompatibleStateImageBehavior = false;
- this.c_Media.View = System.Windows.Forms.View.List;
- //
- // label1
- //
- this.label1.Location = new System.Drawing.Point(10, 16);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(80, 16);
- this.label1.TabIndex = 0;
- this.label1.Text = "ýÌåÀàÐÍ:";
- //
- // radioButtonCD
- //
- this.radioButtonCD.AutoSize = true;
- this.radioButtonCD.Location = new System.Drawing.Point(110, 16);
- this.radioButtonCD.Name = "radioButtonCD";
- this.radioButtonCD.Size = new System.Drawing.Size(65, 16);
- this.radioButtonCD.TabIndex = 4;
- this.radioButtonCD.TabStop = true;
- this.radioButtonCD.Text = "CD-R/RW";
- this.radioButtonCD.UseVisualStyleBackColor = true;
- this.radioButtonCD.CheckedChanged += new System.EventHandler(this.radioButtonCD_CheckedChanged);
- //
- // radioButtonDVD
- //
- this.radioButtonDVD.AutoSize = true;
- this.radioButtonDVD.Location = new System.Drawing.Point(195, 16);
- this.radioButtonDVD.Name = "radioButtonDVD";
- this.radioButtonDVD.Size = new System.Drawing.Size(71, 16);
- this.radioButtonDVD.TabIndex = 4;
- this.radioButtonDVD.TabStop = true;
- this.radioButtonDVD.Text = "DVD-R/RW";
- this.radioButtonDVD.UseVisualStyleBackColor = true;
- this.radioButtonDVD.CheckedChanged += new System.EventHandler(this.radioButtonDVD_CheckedChanged);
- //
- // ChooseMediaForm
- //
- this.AcceptButton = this.c_OK;
- this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
- this.CancelButton = this.c_Cancel;
- this.ClientSize = new System.Drawing.Size(553, 206);
- this.Controls.Add(this.radioButtonDVD);
- this.Controls.Add(this.radioButtonCD);
- this.Controls.Add(this.label1);
- this.Controls.Add(this.c_Media);
- this.Controls.Add(this.c_OK);
- this.Controls.Add(this.c_Cancel);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "ChooseMediaForm";
- this.ShowInTaskbar = false;
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
- this.Text = "Ñ¡ÔñýÌå";
- this.ResumeLayout(false);
- this.PerformLayout();
- }
- #endregion
- public new string ToString ()
- {
- return m_nero.get_TypeNameOfMedia (GetMediaType ());
- }
- public NERO_MEDIA_TYPE GetMediaType ()
- {
- // Return the selected media type. Use uint, then cast
- // to NERO_MEDIA_TYPE.
- //
- uint uType = (uint) NERO_MEDIA_TYPE.NERO_MEDIA_NONE;
- foreach (ListViewItem lvi in c_Media.Items)
- {
- if (lvi.Checked)
- {
- uType |= (uint) (NERO_MEDIA_TYPE) lvi.Tag;
- }
- }
- return (NERO_MEDIA_TYPE) uType;
- }
- public void SetMediaType(string uType="cd")
- {
- this.CMediaType = uType;
- foreach (ListViewItem lvi in c_Media.Items)
- {
- switch ((NERO_MEDIA_TYPE)lvi.Tag)
- {
- case NERO_MEDIA_TYPE.NERO_MEDIA_CD:
- case NERO_MEDIA_TYPE.NERO_MEDIA_CDR:
- case NERO_MEDIA_TYPE.NERO_MEDIA_CDROM:
- case NERO_MEDIA_TYPE.NERO_MEDIA_CDRW:
- case NERO_MEDIA_TYPE.NERO_MEDIA_DDCD:
- case NERO_MEDIA_TYPE.NERO_MEDIA_NO_CDR:
- case NERO_MEDIA_TYPE.NERO_MEDIA_NO_CDRW:
- if (uType == "cd")
- {
- lvi.Checked = true;
- }
- else {
- lvi.Checked = false;
- }
- break;
- default:
- if (uType == "dvd")
- {
- lvi.Checked = true;
- }
- else
- {
- lvi.Checked = false;
- }
- break;
- }
- }
-
- }
- /// <summary>
- /// µ±Ç°Ñ¡ÔñÀàÐÍ
- /// </summary>
- string CMediaType = "cd";
- private void radioButtonCD_CheckedChanged(object sender, EventArgs e)
- {
- SetMediaType("cd");
- }
- private void radioButtonDVD_CheckedChanged(object sender, EventArgs e)
- {
- SetMediaType("dvd");
- }
- }
- }
|