protected virtual void OnAfterSelect(CMSTreeViewEventArgs e) { if (!bEnableSelectEvents) { return; } #if MSTREE_TRACE Debug.Write("EVENT: " + traceCount.ToString() + (e.Selected ? " OnAfterSelect:" : " OnAfterUnselect:")); Debug.Write(" node=" + (e.Node != null ? "\"" + e.Node.Text + "\"" : "null")); Debug.WriteLine(" action=" + e.Action); #endif if (e.Selected) { if (onAfterSelect != null) { onAfterSelect(this, new TreeViewEventArgs(e.Node, e.Action)); } } else { if (onAfterUnselect != null) { onAfterUnselect(this, new TreeViewEventArgs(e.Node, e.Action)); } } }
private unsafe bool WmSelChanged(ref Message m) { if (!bEnableSelectEvents) { return(false); } Native.NMTREEVIEW *nmtv = (Native.NMTREEVIEW *)m.LParam; TreeNode node = TreeNode.FromHandle(this, nmtv->itemNew.hItem); bool bIsSelected = true;//(nmtv->itemNew.state & Native.TVIS.SELECTED) != 0; TreeNode oldNode = TreeNode.FromHandle(this, nmtv->itemOld.hItem); AddSelectedItem(node); CMSTreeViewEventArgs e = new CMSTreeViewEventArgs(node, bIsSelected, TreeViewAction.Unknown); OnAfterSelect(e); OnAfterMultiSelectComplete(new CMSTreeViewMultiSelectEventArgs(SelectedNodes, TreeViewAction.Unknown)); return(false); }