using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using NEROLib;
using System.Runtime.InteropServices;
namespace NeroFiddlesCOM.NET
{
///
/// Summary description for VMSInfo.
///
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;
///
/// Required designer variable.
///
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");
}
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
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
}
}