private static void AddChildrenToItemRecursively( object item, TreeListView.Node node, ITreeListView view, IItemView itemView, ImageList imageList, ImageList stateImageList, IDictionary <object, TreeListView.Node> dictNodes) { if (view == null) { return; } IEnumerable <object> children = view.GetChildren(item); foreach (object child in children) { TreeListView.Node nodeChild = CreateNodeForObject(child, itemView, imageList, stateImageList, dictNodes); if (dictNodes != null) { dictNodes.Add(child, nodeChild); } node.Nodes.Add(nodeChild); AddChildrenToItemRecursively(child, nodeChild, view, itemView, imageList, stateImageList, dictNodes); } }
/// <summary> /// Regenerates selected data items</summary> /// <param name="view">Tree list view</param> /// <param name="selection">Selected data items</param> public static void ModifySelected(ITreeListView view, IEnumerable <object> selection) { var container = view.As <DataContainer>(); if (container == null) { return; } container.ModifySelected(selection.ToList()); }
/// <summary> /// Removes last data item selected</summary> /// <param name="view">Tree list view</param> /// <param name="lastHit">Last data item selected</param> public static void RemoveItem(ITreeListView view, object lastHit) { var container = view.As <DataContainer>(); if (container == null) { return; } container.RemoveItem(lastHit.As <DataItem>()); }
/// <summary> /// Updates generated data items</summary> /// <param name="view">Tree list view</param> public static void Reload(ITreeListView view) { var container = view.As <DataContainer>(); if (container == null) { return; } container.Reload(); }
/// <summary> /// Generates data for a virtual list</summary> /// <param name="view">Tree list view</param> public static void GenerateVirtual(ITreeListView view) { var container = view.As <DataContainer>(); if (container == null) { return; } container.GenerateVirtual(); }
/// <summary> /// Generates a list of hierarchical data</summary> /// <param name="view">Tree list view</param> /// <param name="lastHit">Last data item selected</param> public static void GenerateHierarchical(ITreeListView view, object lastHit) { var container = view.As <DataContainer>(); if (container == null) { return; } container.GenerateHierarchical(lastHit.As <DataItem>()); }
private static void AddChildrenToItemRecursively( object item, TreeListView.Node node, ITreeListView view, IItemView itemView, ImageList imageList, ImageList stateImageList, IDictionary<object, TreeListView.Node> dictNodes) { if (view == null) return; IEnumerable<object> children = view.GetChildren(item); foreach (object child in children) { TreeListView.Node nodeChild = CreateNodeForObject(child, itemView, imageList, stateImageList, dictNodes); if (dictNodes != null) dictNodes.Add(child, nodeChild); node.Nodes.Add(nodeChild); AddChildrenToItemRecursively(child, nodeChild, view, itemView, imageList, stateImageList, dictNodes); } }