コード例 #1
0
        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);
            }
        }
コード例 #2
0
        /// <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());
        }
コード例 #3
0
        /// <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>());
        }
コード例 #4
0
        /// <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();
        }
コード例 #5
0
        /// <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();
        }
コード例 #6
0
        /// <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>());
        }
コード例 #7
0
        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);
            }
        }