123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- using System;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
- using NEROLib;
- using System.Runtime.InteropServices;
- namespace LYFZ.NeroDiscBurn.NET
- {
- /// <summary>
- /// Summary description for VMSInfo.
- /// </summary>
- public class VMSInfoForm : System.Windows.Forms.Form
- {
- public NeroDrive m_drive;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Label c_Count;
- private System.Windows.Forms.Button c_OK;
- private System.Windows.Forms.ColumnHeader columnHeader1;
- private System.Windows.Forms.ColumnHeader columnHeader2;
- private System.Windows.Forms.ListView c_Sessions;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.Container components = null;
- public VMSInfoForm()
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
- }
-
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad (e);
- // When the form is loaded, try getting the VMS info.
- //
- try
- {
- NeroVMSInfo vms = m_drive.GetVMSInfo ();
- c_Count.Text = vms.Count.ToString ();
- // Add each VMS entry to the list view.
- //
- int i = 0;
- foreach (NeroVMSSession sess in vms)
- {
- ListViewItem lvi = c_Sessions.Items.Add ((i+1).ToString ());
- lvi.SubItems.Add (sess.SessionName);
- i ++;
- }
- }
- catch (COMException)
- {
- ListViewItem lvi = c_Sessions.Items.Add ("");
- lvi.SubItems.Add ("no VMS info");
- }
- }
- /// <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()
- {
- this.label1 = new System.Windows.Forms.Label();
- this.c_Count = new System.Windows.Forms.Label();
- this.c_OK = new System.Windows.Forms.Button();
- this.c_Sessions = new System.Windows.Forms.ListView();
- this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
- this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
- this.SuspendLayout();
- //
- // label1
- //
- this.label1.Location = new System.Drawing.Point(8, 8);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(72, 16);
- this.label1.TabIndex = 0;
- this.label1.Text = "VMS Count:";
- //
- // c_Count
- //
- this.c_Count.Location = new System.Drawing.Point(88, 8);
- this.c_Count.Name = "c_Count";
- this.c_Count.Size = new System.Drawing.Size(32, 16);
- this.c_Count.TabIndex = 1;
- this.c_Count.Text = "0";
- //
- // c_OK
- //
- this.c_OK.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.c_OK.Location = new System.Drawing.Point(264, 8);
- this.c_OK.Name = "c_OK";
- this.c_OK.TabIndex = 3;
- this.c_OK.Text = "OK";
- //
- // c_Sessions
- //
- this.c_Sessions.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
- this.columnHeader1,
- this.columnHeader2});
- this.c_Sessions.FullRowSelect = true;
- this.c_Sessions.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
- this.c_Sessions.Location = new System.Drawing.Point(8, 40);
- this.c_Sessions.MultiSelect = false;
- this.c_Sessions.Name = "c_Sessions";
- this.c_Sessions.Size = new System.Drawing.Size(248, 96);
- this.c_Sessions.TabIndex = 2;
- this.c_Sessions.View = System.Windows.Forms.View.Details;
- //
- // columnHeader1
- //
- this.columnHeader1.Text = "#";
- this.columnHeader1.Width = 30;
- //
- // columnHeader2
- //
- this.columnHeader2.Text = "Name";
- this.columnHeader2.Width = 196;
- //
- // VMSInfoForm
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.CancelButton = this.c_OK;
- this.ClientSize = new System.Drawing.Size(346, 152);
- this.Controls.Add(this.c_Sessions);
- this.Controls.Add(this.c_OK);
- this.Controls.Add(this.c_Count);
- this.Controls.Add(this.label1);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "VMSInfoForm";
- this.ShowInTaskbar = false;
- this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
- this.Text = "VMSInfo";
- this.ResumeLayout(false);
- }
- #endregion
- }
- }
|