Exemplo n.º 1
0
        /// <summary>
        /// Search for nodes in the specified forest by link value.
        /// </summary>
        /// <param name="forestID">The forest in which to search for nodes.</param>
        /// <param name="link">the link value to search for.</param>
        /// <param name="returnLinks">Should link values be returned in the results?</param>
        /// <returns>Does not return anything.</returns>
        private async Task SearchNodesInForest(string forestID, string link, bool returnLinks = false)
        {
            if (!string.IsNullOrEmpty(forestID))
            {
                var searchNodesRequest = new SearchNodesRequest
                {
                    ForestId = forestID,
                    Link     = link,
                    NoLinks  = !returnLinks,
                };

                Console.WriteLine($"Search nodes for link {link} in forest {forestID} results:");

                await this.orgClient.SearchAllNodesAsync(searchNodesRequest, this.PrintNodes).ConfigureAwait(false);

                Console.WriteLine();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Search for nodes in the specified tree by link value.
        /// </summary>
        /// <param name="parentTree">The tree in which to search for nodes.</param>
        /// <param name="link">the link value to search for.</param>
        /// <param name="returnLinks">Should link values be returned in the results?</param>
        /// <returns>Does not return anything.</returns>
        private async Task SearchNodesInTree(Tree parentTree, string link, bool returnLinks = false)
        {
            if (parentTree != null)
            {
                var searchNodesRequest = new SearchNodesRequest
                {
                    ForestId = parentTree.ForestId,
                    TreeId   = parentTree.Id,
                    Link     = link,
                    NoLinks  = !returnLinks,
                };

                Console.WriteLine($"Search nodes for link {link} in tree {parentTree.ForestId}/{parentTree.Id} results:");

                await this.orgClient.SearchAllNodesAsync(searchNodesRequest, this.PrintNodes).ConfigureAwait(false);

                Console.WriteLine();
            }
        }