2012-11-04 01:36:12 +00:00
|
|
|
using System;
|
2012-11-05 04:18:25 +00:00
|
|
|
using MonoMac.Foundation;
|
|
|
|
using MonoMac.AppKit;
|
|
|
|
using NBTExplorer.Model;
|
|
|
|
using System.Collections.Generic;
|
2012-11-04 01:36:12 +00:00
|
|
|
|
2012-11-05 04:18:25 +00:00
|
|
|
namespace NBTExplorer.Mac
|
2012-11-04 01:36:12 +00:00
|
|
|
{
|
2012-11-05 04:18:25 +00:00
|
|
|
public class TreeDataNode : NSObject
|
2012-11-04 01:36:12 +00:00
|
|
|
{
|
2012-11-05 04:18:25 +00:00
|
|
|
private DataNode _dataNode;
|
|
|
|
private List<TreeDataNode> _children;
|
|
|
|
private bool _expanded;
|
|
|
|
|
|
|
|
public TreeDataNode (DataNode node)
|
|
|
|
{
|
|
|
|
_dataNode = node;
|
|
|
|
_children = new List<TreeDataNode>();
|
|
|
|
}
|
|
|
|
|
|
|
|
public DataNode Data
|
|
|
|
{
|
|
|
|
get { return _dataNode; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public string CombinedName
|
|
|
|
{
|
|
|
|
get { return _dataNode.NodeDisplay; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public string Name
|
|
|
|
{
|
|
|
|
get { return _dataNode.NodeName; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool IsExpanded
|
|
|
|
{
|
|
|
|
get { return _expanded; }
|
|
|
|
set { _expanded = value; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool HasChildren
|
|
|
|
{
|
|
|
|
get { return _children.Count > 0 || _dataNode.HasUnexpandedChildren; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<TreeDataNode> Nodes
|
2012-11-04 01:36:12 +00:00
|
|
|
{
|
2012-11-05 04:18:25 +00:00
|
|
|
get { return _children; }
|
2012-11-04 01:36:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|