void ShowProperties(ICSharpCode.TreeView.SharpTreeView t) { if (t.SelectedItems.Count == 1) { ShopdrawingTreeNode node = t.SelectedItem as ShopdrawingTreeNode; PropertyGrid.SelectedObject = node.DataObject; } else { ShopdrawingTreeNode nodes = t.SelectedItems as ShopdrawingTreeNode; } }
void projectTree_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (e.ChangedButton == MouseButton.Left) { ICSharpCode.TreeView.SharpTreeView t = sender as ICSharpCode.TreeView.SharpTreeView; if (t.SelectedItems.Count == 1) { ShopdrawingTreeNode node = t.SelectedItem as ShopdrawingTreeNode; if (node.Children.Count == 0) { MessageBox.Show(node.DataObject != null ? node.DataObject.ToString() : "Null"); } } } }