Skip to content

Commit

Permalink
AfterSelect event definition added.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-valdron committed Jul 10, 2023
1 parent 660ae69 commit 2d0660c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions DirectoryTree/DirectoryTreeControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.IO;
using System.Collections.Generic;
using System;
using System.ComponentModel;

namespace DirectoryTree
{
Expand All @@ -20,6 +21,18 @@ public partial class DirectoryTreeControl : UserControl
private DirectoryInfo selDir;
private bool initialized;

/// <summary>
/// Represents the method that will handle the events of a DirectoryTree.DirectoryTreeControl
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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();
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2d0660c

Please sign in to comment.