Ejemplo n.º 1
0
        /// <summary>
        /// Tries to get the child <see cref="LoadingTreeNode"/>.
        /// </summary>
        /// <param name="treeNode">The parent tree node.</param>
        /// <param name="loadingTreeNode">The loading tree node, if any.</param>
        /// <returns><c>true</c> if the <paramref name="treeNode"/> had a <see cref="LoadingTreeNode"/>.</returns>
        public static bool TryGetLoadingNode(TreeNode treeNode, out LoadingTreeNode loadingTreeNode)
        {
            if ((treeNode.Nodes.Count == 1) && (treeNode.Nodes[0] is LoadingTreeNode))
            {
                loadingTreeNode = (LoadingTreeNode)treeNode.Nodes[0];
                return(true);
            }

            loadingTreeNode = null;
            return(false);
        }
Ejemplo n.º 2
0
        private bool EnsureChildNodesAreLoaded(TreeNode parentNode, ReportingService2005 reportingService, bool source)
        {
            LoadingTreeNode loadingTreeNode;

            if (LoadingTreeNode.TryGetLoadingNode(parentNode, out loadingTreeNode))
            {
                parentNode.Nodes.Clear();
                LoadTreeNode(loadingTreeNode.SsrsPath, parentNode.Nodes, reportingService, source);

                return(true);
            }

            return(false);
        }