diff --git a/DirectoryTree/DirectoryTreeControl.cs b/DirectoryTree/DirectoryTreeControl.cs index 667bd06..d85b51f 100644 --- a/DirectoryTree/DirectoryTreeControl.cs +++ b/DirectoryTree/DirectoryTreeControl.cs @@ -11,6 +11,7 @@ using System.IO; using System.Collections.Generic; using System; +using System.ComponentModel; namespace DirectoryTree { @@ -20,6 +21,18 @@ public partial class DirectoryTreeControl : UserControl private DirectoryInfo selDir; private bool initialized; + /// + /// Represents the method that will handle the events of a DirectoryTree.DirectoryTreeControl + /// + /// + /// + public delegate void DirectoryTreeEventHandler(object sender, TreeViewEventArgs e); + + [Browsable(true)] + [Category("Actions")] + [Description("Occurs when the directory selection has been changed.")] + public event DirectoryTreeEventHandler AfterSelect; + public DirectoryTreeControl() { InitializeComponent(); @@ -135,6 +148,8 @@ private void TvDirView_AfterSelect(object sender, TreeViewEventArgs e) { initialized = false; SelectedPath = tvDirView.SelectedNode.FullPath; + + AfterSelect?.Invoke(this, e); } else initialized = true;