protected virtual void OnNodeSelect(ListExplorerNode node) { Text = node.ToString(); Selection.Current = node; toolTree.Field.DropDown.Hide(); toolTree.DataValue = node; node.Apply(Editor); if (!node.Check) { OnNodeCheck(node); } }
private void InitializeTree() { Tree.Nodes.Clear(); Tree.Tag = DataSource; if (DataSource == null) { Editor.DataSource = null; return; } var node = new ListExplorerNode() { Text = Locale.Get(DataSource.GetType().FullName, DataSource.GetType().Name), DataSource = DataSource }; Tree.Nodes.Add(node); Tree.SelectedNode = node; }
protected virtual void OnEditorItemSelect(object sender, ListEditorEventArgs e) { if (Current != null) { e.Cancel = true; foreach (ListExplorerNode node in Tree.SelectedNode.Nodes) { if (node.DataSource == e.Item) { Current = node; return; } } var newNode = new ListExplorerNode(e.Item.ToString()) { Text = e.Item.ToString(), DataSource = e.Item, Group = Current }; Current = newNode; } }
protected virtual void OnNodeCheck(ListExplorerNode node) { if (node.DataSource == null) { return; } foreach (var property in node.DataSource.GetType().GetProperties()) { if (TypeHelper.GetBrowsable(property) && TypeHelper.IsList(property.PropertyType) && !TypeHelper.IsIndex(property)) { Node propertyNode = InitNode(property, EmitInvoker.GetValue(property, node.DataSource)); if (propertyNode != null) { propertyNode.Group = node; } else { Tree.Nodes.Add(propertyNode); } } } node.Check = true; }