174 lines
5.8 KiB
C#
174 lines
5.8 KiB
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
using MyNes.Core;
|
|
using MyNes.Properties;
|
|
|
|
namespace MyNes;
|
|
|
|
public class FormBoardList : Form
|
|
{
|
|
private IContainer components;
|
|
|
|
private Panel panel1;
|
|
|
|
private ListView listView1;
|
|
|
|
private ColumnHeader columnHeader1;
|
|
|
|
private ColumnHeader columnHeader2;
|
|
|
|
private ColumnHeader columnHeader3;
|
|
|
|
private Button button1;
|
|
|
|
private ImageList imageList1;
|
|
|
|
private ColumnHeader columnHeader4;
|
|
|
|
private ColumnHeader columnHeader5;
|
|
|
|
private CheckBox checkBox1;
|
|
|
|
private Label label_supportedN;
|
|
|
|
private RichTextBox richTextBox1;
|
|
|
|
public FormBoardList()
|
|
{
|
|
InitializeComponent();
|
|
ShowMappers();
|
|
}
|
|
|
|
private void ShowMappers()
|
|
{
|
|
listView1.Items.Clear();
|
|
BoardInfoObject[] boardsList = MyNesMain.GetBoardsList(!checkBox1.Checked);
|
|
int num = 0;
|
|
BoardInfoObject[] array = boardsList;
|
|
foreach (BoardInfoObject boardInfoObject in array)
|
|
{
|
|
ListViewItem listViewItem = new ListViewItem();
|
|
listViewItem.Text = boardInfoObject.MapperNumber.ToString();
|
|
listViewItem.SubItems.Add(boardInfoObject.Name);
|
|
listViewItem.SubItems.Add(boardInfoObject.IsSupported ? Resources.Yes : Resources.No);
|
|
listViewItem.SubItems.Add(boardInfoObject.HasIssues ? Resources.Yes : Resources.No);
|
|
listViewItem.SubItems.Add(boardInfoObject.Issues);
|
|
if (boardInfoObject.IsSupported)
|
|
{
|
|
listViewItem.ImageIndex = (boardInfoObject.HasIssues ? 2 : 0);
|
|
num++;
|
|
}
|
|
else
|
|
{
|
|
listViewItem.ImageIndex = 1;
|
|
}
|
|
listView1.Items.Add(listViewItem);
|
|
}
|
|
label_supportedN.Text = Resources.Status45 + " " + num + " " + Resources.Status46;
|
|
}
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
{
|
|
Close();
|
|
}
|
|
|
|
private void checkBox1_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
ShowMappers();
|
|
}
|
|
|
|
private void listView1_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
if (listView1.SelectedItems.Count == 1)
|
|
{
|
|
richTextBox1.Text = listView1.SelectedItems[0].SubItems[4].Text;
|
|
}
|
|
else
|
|
{
|
|
richTextBox1.Text = "";
|
|
}
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (disposing && components != null)
|
|
{
|
|
components.Dispose();
|
|
}
|
|
base.Dispose(disposing);
|
|
}
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
this.components = new System.ComponentModel.Container();
|
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MyNes.FormBoardList));
|
|
this.panel1 = new System.Windows.Forms.Panel();
|
|
this.label_supportedN = new System.Windows.Forms.Label();
|
|
this.checkBox1 = new System.Windows.Forms.CheckBox();
|
|
this.button1 = new System.Windows.Forms.Button();
|
|
this.listView1 = new System.Windows.Forms.ListView();
|
|
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
|
|
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
|
|
this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
|
|
this.columnHeader4 = new System.Windows.Forms.ColumnHeader();
|
|
this.columnHeader5 = new System.Windows.Forms.ColumnHeader();
|
|
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
|
|
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
|
|
this.panel1.SuspendLayout();
|
|
base.SuspendLayout();
|
|
this.panel1.Controls.Add(this.label_supportedN);
|
|
this.panel1.Controls.Add(this.checkBox1);
|
|
this.panel1.Controls.Add(this.button1);
|
|
resources.ApplyResources(this.panel1, "panel1");
|
|
this.panel1.Name = "panel1";
|
|
resources.ApplyResources(this.label_supportedN, "label_supportedN");
|
|
this.label_supportedN.Name = "label_supportedN";
|
|
resources.ApplyResources(this.checkBox1, "checkBox1");
|
|
this.checkBox1.Name = "checkBox1";
|
|
this.checkBox1.UseVisualStyleBackColor = true;
|
|
this.checkBox1.CheckedChanged += new System.EventHandler(checkBox1_CheckedChanged);
|
|
resources.ApplyResources(this.button1, "button1");
|
|
this.button1.Name = "button1";
|
|
this.button1.UseVisualStyleBackColor = true;
|
|
this.button1.Click += new System.EventHandler(button1_Click);
|
|
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[5] { this.columnHeader1, this.columnHeader2, this.columnHeader3, this.columnHeader4, this.columnHeader5 });
|
|
resources.ApplyResources(this.listView1, "listView1");
|
|
this.listView1.FullRowSelect = true;
|
|
this.listView1.GridLines = true;
|
|
this.listView1.MultiSelect = false;
|
|
this.listView1.Name = "listView1";
|
|
this.listView1.ShowItemToolTips = true;
|
|
this.listView1.SmallImageList = this.imageList1;
|
|
this.listView1.UseCompatibleStateImageBehavior = false;
|
|
this.listView1.View = System.Windows.Forms.View.Details;
|
|
this.listView1.SelectedIndexChanged += new System.EventHandler(listView1_SelectedIndexChanged);
|
|
resources.ApplyResources(this.columnHeader1, "columnHeader1");
|
|
resources.ApplyResources(this.columnHeader2, "columnHeader2");
|
|
resources.ApplyResources(this.columnHeader3, "columnHeader3");
|
|
resources.ApplyResources(this.columnHeader4, "columnHeader4");
|
|
resources.ApplyResources(this.columnHeader5, "columnHeader5");
|
|
this.imageList1.ImageStream = (System.Windows.Forms.ImageListStreamer)resources.GetObject("imageList1.ImageStream");
|
|
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
|
|
this.imageList1.Images.SetKeyName(0, "accept.png");
|
|
this.imageList1.Images.SetKeyName(1, "cross.png");
|
|
this.imageList1.Images.SetKeyName(2, "error.png");
|
|
resources.ApplyResources(this.richTextBox1, "richTextBox1");
|
|
this.richTextBox1.Name = "richTextBox1";
|
|
base.AcceptButton = this.button1;
|
|
resources.ApplyResources(this, "$this");
|
|
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
|
base.Controls.Add(this.listView1);
|
|
base.Controls.Add(this.richTextBox1);
|
|
base.Controls.Add(this.panel1);
|
|
base.MinimizeBox = false;
|
|
base.Name = "FormBoardList";
|
|
base.ShowIcon = false;
|
|
base.ShowInTaskbar = false;
|
|
this.panel1.ResumeLayout(false);
|
|
this.panel1.PerformLayout();
|
|
base.ResumeLayout(false);
|
|
}
|
|
}
|