External/Aga.Controls/Tree/TreeModelBase.cs
author moel.mich
Sun, 23 Sep 2012 18:37:43 +0000
changeset 380 573f1fff48b2
permissions -rw-r--r--
Fixed Issue 387. The new implementation does not try to start a ring 0 driver that already exists, but could not be opened. It tries to delete the driver and install it new. The driver is now stored temporarily in the application folder. The driver is not correctly removed on system shutdown.
     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 }