moel@345: using System;
moel@345: using System.Collections.Generic;
moel@345: using System.Text;
moel@345: 
moel@345: namespace Aga.Controls.Tree
moel@345: {
moel@345: 	public abstract class TreeModelBase: ITreeModel
moel@345: 	{
moel@345: 		public abstract System.Collections.IEnumerable GetChildren(TreePath treePath);
moel@345: 		public abstract bool IsLeaf(TreePath treePath);
moel@345: 
moel@345: 
moel@345: 		public event EventHandler<TreeModelEventArgs> NodesChanged;
moel@345: 		protected void OnNodesChanged(TreeModelEventArgs args)
moel@345: 		{
moel@345: 			if (NodesChanged != null)
moel@345: 				NodesChanged(this, args);
moel@345: 		}
moel@345: 
moel@345: 		public event EventHandler<TreePathEventArgs> StructureChanged;
moel@345: 		protected void OnStructureChanged(TreePathEventArgs args)
moel@345: 		{
moel@345: 			if (StructureChanged != null)
moel@345: 				StructureChanged(this, args);
moel@345: 		}
moel@345: 
moel@345: 		public event EventHandler<TreeModelEventArgs> NodesInserted;
moel@345: 		protected void OnNodesInserted(TreeModelEventArgs args)
moel@345: 		{
moel@345: 			if (NodesInserted != null)
moel@345: 				NodesInserted(this, args);
moel@345: 		}
moel@345: 
moel@345: 		public event EventHandler<TreeModelEventArgs> NodesRemoved;
moel@345: 		protected void OnNodesRemoved(TreeModelEventArgs args)
moel@345: 		{
moel@345: 			if (NodesRemoved != null)
moel@345: 				NodesRemoved(this, args);
moel@345: 		}
moel@345: 
moel@345: 		public virtual void Refresh()
moel@345: 		{
moel@345: 			OnStructureChanged(new TreePathEventArgs(TreePath.Empty));
moel@345: 		}
moel@345: 	}
moel@345: }