/// <summary> /// 選択イベント /// </summary> /// <param name="e"></param> protected virtual void OnSelected(DirectoryTreeViewSelectedEventArgs e) { // イベントハンドラ呼出し if (this.Selected != null) { // 呼出し this.Selected(this, e); } }
/// <summary> /// NodeMouseClick /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DirectoryTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { Trace.WriteLine("DirectoryTreeView::DirectoryTreeView_NodeMouseClick(object, TreeNodeMouseClickEventArgs)"); DirectoryTreeNode mouseClick = (DirectoryTreeNode)e.Node; Debug.WriteLine("Mouse Click Node:" + mouseClick.FullPath); // イベント情報生成 DirectoryTreeViewSelectedEventArgs _args = new DirectoryTreeViewSelectedEventArgs(); _args.Info = mouseClick.Info; // 更新イベント this.OnSelected(_args); }
/// <summary> /// SetSelected /// </summary> /// <param name="path"></param> public void SetSelected(string path) { Trace.WriteLine("DirectoryTreeView::SetSelected(string)"); Debug.WriteLine("path:" + path); // ノード検索 DirectoryTreeNode findNode = this.FindNode(path); if (findNode == null) { return; } this.SelectedNode = findNode; // イベント情報生成 DirectoryTreeViewSelectedEventArgs _args = new DirectoryTreeViewSelectedEventArgs(); _args.Info = findNode.Info; // 更新イベント this.OnSelected(_args); }
/// <summary> /// DirectoryTreeView選択時イベント /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void DirectoryTreeView_Selected(object sender, EventArgs e) { DirectoryTreeViewSelectedEventArgs args = (DirectoryTreeViewSelectedEventArgs)e; this.Update(args.Info.FullName); }