private void CreateAndAppendBusinessObjectNodes( BocTreeNode parentNode, IBusinessObjectWithIdentity parentBusinessObject, IBusinessObjectReferenceProperty parentProperty) { var children = GetBusinessObjects(parentNode, parentBusinessObject, parentProperty); for (int i = 0; i < children.Length; i++) { IBusinessObjectWithIdentity childBusinessObject = children[i]; BusinessObjectTreeNode childNode = CreateBusinessObjectNode(parentProperty, childBusinessObject); parentNode.Children.Add(childNode); } }
private void Page_Load(object sender, EventArgs e) { Guid personID = new Guid(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); Person person = Person.GetObject(personID); CurrentObject.BusinessObject = (IBusinessObject)person; DataBind(); if (person.Children == null) { person.Children = null; ((Global)Context.ApplicationInstance).XmlReflectionBusinessObjectStorageProvider.Reset(); } CurrentObject.LoadValues(IsPostBack); BocTreeNode node = PersonTreeView.SelectedNode; }
protected override IBusinessObjectWithIdentity[] GetBusinessObjects( BocTreeNode parentNode, IBusinessObjectWithIdentity parent, IBusinessObjectReferenceProperty property) { if (parent.UniqueIdentifier == new Guid(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1).ToString()) { IList children = (IList)parent.GetProperty(property); ArrayList childrenList = new ArrayList(); for (int i = 0; i < children.Count; i++) { if (i != 1) { childrenList.Add(children[i]); } } return((IBusinessObjectWithIdentity[])childrenList.ToArray(typeof(IBusinessObjectWithIdentity))); } return(base.GetBusinessObjects(parentNode, parent, property)); }
protected virtual IBusinessObjectWithIdentity[] GetBusinessObjects( BocTreeNode parentNode, IBusinessObjectWithIdentity parentBusinessObject, IBusinessObjectReferenceProperty parentProperty) { ArgumentUtility.CheckNotNull("parentNode", parentNode); ArgumentUtility.CheckNotNull("parentBusinessObject", parentBusinessObject); ArgumentUtility.CheckNotNull("parentProperty", parentProperty); IList children = (IList)parentBusinessObject.GetProperty(parentProperty); if (children == null) { return(new IBusinessObjectWithIdentity[0]); } return(children.Cast <IBusinessObjectWithIdentity>().ToArray()); }
public void RefreshTreeNodes() { BocTreeNode selectedNode = (BocTreeNode)_treeView.SelectedNode; string selectedNodePath = selectedNodePath = _treeView.FormatNodePath(selectedNode); InvalidateTreeNodes(); InitializeRootWebTreeNodes(); if (!string.IsNullOrEmpty(selectedNodePath)) { string[] pathSegments; selectedNode = (BocTreeNode)_treeView.ParseNodePath(selectedNodePath, out pathSegments); if (selectedNode != null) { selectedNode.IsSelected = true; } } if (selectedNodePath != _treeView.FormatNodePath(selectedNode)) { OnSelectionChanged(selectedNode); } }
protected override void OnPreRender(EventArgs e) { BocTreeNode node = PersonTreeView.SelectedNode; base.OnPreRender(e); }