NBTExplorer/Windows/SearchStateWin.cs

48 lines
1.5 KiB
C#
Raw Normal View History

2012-11-10 19:00:11 +00:00
using System;
using System.Collections.Generic;
using System.Text;
using NBTExplorer.Model;
using System.Windows.Forms;
namespace NBTExplorer.Windows
{
2012-11-20 06:02:35 +00:00
internal class SearchStateWin : NameValueSearchState
2012-11-10 19:00:11 +00:00
{
private ContainerControl _sender;
public SearchStateWin (ContainerControl sender)
{
_sender = sender;
}
public Action<DataNode> DiscoverCallback { get; set; }
public Action<DataNode> ProgressCallback { get; set; }
public Action<DataNode> CollapseCallback { get; set; }
public Action<DataNode> EndCallback { get; set; }
2012-11-20 06:02:35 +00:00
public override void InvokeDiscoverCallback (DataNode node)
2012-11-10 19:00:11 +00:00
{
if (_sender != null && DiscoverCallback != null)
_sender.BeginInvoke(DiscoverCallback, new object[] { node });
}
2012-11-20 06:02:35 +00:00
public override void InvokeProgressCallback (DataNode node)
2012-11-10 19:00:11 +00:00
{
if (_sender != null && ProgressCallback != null)
_sender.BeginInvoke(ProgressCallback, new object[] { node });
}
2012-11-20 06:02:35 +00:00
public override void InvokeCollapseCallback (DataNode node)
2012-11-10 19:00:11 +00:00
{
if (_sender != null && CollapseCallback != null)
_sender.BeginInvoke(CollapseCallback, new object[] { node });
}
2012-11-20 06:02:35 +00:00
public override void InvokeEndCallback (DataNode node)
2012-11-10 19:00:11 +00:00
{
if (_sender != null && EndCallback != null)
_sender.BeginInvoke(EndCallback, new object[] { node });
}
}
}