55 lines
1.3 KiB
C#
55 lines
1.3 KiB
C#
using Remontor.Connector;
|
|
using Remontor.Setting;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Remontor.History
|
|
{
|
|
[Serializable]
|
|
internal static class HistoryList
|
|
{
|
|
static public List<HistoryItem> Hitem = new List<HistoryItem>();
|
|
//static private FormHistory formHistory;
|
|
|
|
public delegate void UpdateMethod(List<HistoryItem> items);
|
|
static public event UpdateMethod Update;
|
|
static public HistoryItem Add(Connect connect)
|
|
{
|
|
|
|
HistoryItem historyItem = new HistoryItem(connect);
|
|
Hitem.Insert(0, historyItem);
|
|
ClearFirst();
|
|
Update(Hitem);
|
|
|
|
return historyItem;
|
|
|
|
}
|
|
static public void Updated()
|
|
{
|
|
Update(Hitem);
|
|
}
|
|
static public void Clear()
|
|
{
|
|
Hitem.Clear();
|
|
}
|
|
|
|
static public void ClearFirst()
|
|
{
|
|
if(Hitem.Count > SGlobalSetting.settingReboot.sizeHistoryItem)
|
|
{
|
|
Hitem.RemoveAt(Hitem.Count() - 1);
|
|
ClearFirst();
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
}
|