📄 hiscoreform.cs
字号:
////////////////////////////////////////////////
//
// Project: Lines.NET
// Version: 1.1
// Author: Vladimir L.
//
// homepage: http://www.boomsoft.org
// e-mail: support@boomsoft.org
//
// Copyright (c) 2003-2004, Boomsoft.org
//
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using Lines.Core;
namespace Lines
{
/// <summary>
/// Describes dialog that is dedicated to display information about players HiScore.
/// </summary>
public class HiScoreForm : Form
{
private ColumnHeader columnNo;
private ColumnHeader columnName;
private ColumnHeader columnScore;
private ColumnHeader columnSteps;
private ListView recordList;
private Button buttonOk;
/// <summary>
/// Creates and initializes an instance of HiScoreForm class.
/// </summary>
public HiScoreForm()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
}
/// <summary>
/// Updates the list view of player records with new information provided with an instance of
/// <see cref="Core.HiScoreList"/> class.
/// </summary>
/// <param name="records">The list that contains infrormation about records to be displayed.</param>
public void UpdateRecordList(HiScoreList records)
{
recordList.Items.Clear();
int pos = 1;
foreach (HiScoreList.PlayerScore playerScore in records)
{
if (playerScore != null)
{
ListViewItem item = new ListViewItem(
new string[4] {
pos.ToString(),
playerScore.Name,
playerScore.Score.ToString(),
playerScore.Steps.ToString()
});
recordList.Items.Add(item);
pos++;
}
}
}
/// <summary>
/// Cleans up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
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.recordList = new System.Windows.Forms.ListView();
this.columnNo = new System.Windows.Forms.ColumnHeader();
this.columnName = new System.Windows.Forms.ColumnHeader();
this.columnScore = new System.Windows.Forms.ColumnHeader();
this.columnSteps = new System.Windows.Forms.ColumnHeader();
this.buttonOk = new System.Windows.Forms.Button();
//
// recordList
//
this.recordList.Columns.Add(this.columnNo);
this.recordList.Columns.Add(this.columnName);
this.recordList.Columns.Add(this.columnScore);
this.recordList.Columns.Add(this.columnSteps);
this.recordList.FullRowSelect = true;
this.recordList.Size = new System.Drawing.Size(240, 184);
this.recordList.View = System.Windows.Forms.View.Details;
//
// columnNo
//
this.columnNo.Text = "
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -