protected override void OnAfterSelect(TreeViewEventArgs e) { base.OnAfterSelect(e); // Raise the DirectorySelected event. DirectorySelected?.Invoke(this, new DirectorySelectedEventArgs(e.Node.FullPath)); }
protected override void OnClick(EventArgs e) { base.OnClick(e); fileDialog.ShowDialog(); SelectedDirectory = fileDialog.SelectedPath; if (SelectedDirectory.Length > 0) { DirectorySelected?.Invoke(this, SelectedDirectory); Console.WriteLine($"Selected file {SelectedDirectory}"); } }
/// <summary> /// 目录选择 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void treeDir_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e) { DirectorySelected?.Invoke(sender, e); }