External/Aga.Controls/Tree/TreeModelBase.cs
author StephaneLenclud
Sun, 03 Feb 2013 18:01:50 +0100
branchMiniDisplay
changeset 433 090259cfd699
permissions -rw-r--r--
Adding SoundGraphDisplay and SensorFrontView classes.
They were respectively based on SystemTray and SensorNotifyIcon.
SoundGraphDisplay is now able to load iMONDisplay.dll providing it lives on your PATH.
Adding option to sensor context menu for adding it into FrontView.
     1 using System;
     2 using System.Collections.Generic;
     3 using System.Text;
     4 
     5 namespace Aga.Controls.Tree
     6 {
     7 	public abstract class TreeModelBase: ITreeModel
     8 	{
     9 		public abstract System.Collections.IEnumerable GetChildren(TreePath treePath);
    10 		public abstract bool IsLeaf(TreePath treePath);
    11 
    12 
    13 		public event EventHandler<TreeModelEventArgs> NodesChanged;
    14 		protected void OnNodesChanged(TreeModelEventArgs args)
    15 		{
    16 			if (NodesChanged != null)
    17 				NodesChanged(this, args);
    18 		}
    19 
    20 		public event EventHandler<TreePathEventArgs> StructureChanged;
    21 		protected void OnStructureChanged(TreePathEventArgs args)
    22 		{
    23 			if (StructureChanged != null)
    24 				StructureChanged(this, args);
    25 		}
    26 
    27 		public event EventHandler<TreeModelEventArgs> NodesInserted;
    28 		protected void OnNodesInserted(TreeModelEventArgs args)
    29 		{
    30 			if (NodesInserted != null)
    31 				NodesInserted(this, args);
    32 		}
    33 
    34 		public event EventHandler<TreeModelEventArgs> NodesRemoved;
    35 		protected void OnNodesRemoved(TreeModelEventArgs args)
    36 		{
    37 			if (NodesRemoved != null)
    38 				NodesRemoved(this, args);
    39 		}
    40 
    41 		public virtual void Refresh()
    42 		{
    43 			OnStructureChanged(new TreePathEventArgs(TreePath.Empty));
    44 		}
    45 	}
    46 }