Ejemplo n.º 1
0
        /// <summary>
        /// Get information about taxon trees that matches the search criteria.
        /// </summary>
        /// <param name="searchCriteria">The taxon trees search criteria.</param>
        /// <returns>Taxon trees</returns>
        /// <exception cref="ArgumentException">Thrown if searchCriteria is null.</exception>
        public static TaxonTreeNodeList GetTaxonTreesBySearchCriteria(TaxonTreeSearchCriteria searchCriteria)
        {
            TaxonTreeNodeList          taxonTrees;
            List <WebTaxonTreeNode>    webTaxonTrees;
            WebTaxonTreeSearchCriteria webSearchCriteria;

            // Check arguments.
            searchCriteria.CheckNotNull("searchCriteria");

            // Get data from web service.
            webSearchCriteria = GetTaxonTreeSearchCriteria(searchCriteria);
            webTaxonTrees     = WebServiceClient.GetTaxonTreesBySearchCriteria(webSearchCriteria);
            taxonTrees        = new TaxonTreeNodeList();
            foreach (WebTaxonTreeNode webTaxonTree in webTaxonTrees)
            {
                taxonTrees.Add(GetTaxonTree(webTaxonTree));
            }
            return(taxonTrees);
        }
 /// <summary>
 /// Add a taxon tree node to the parents
 /// of this taxon tree node.
 /// </summary>
 /// <param name='taxonTreeNode'>Taxon tree node to add.</param>
 public void AddParent(TaxonTreeNode taxonTreeNode)
 {
     _parents.Add(taxonTreeNode);
 }
 /// <summary>
 /// Add a taxon tree node to the children
 /// of this taxon tree node.
 /// </summary>
 /// <param name='taxonTreeNode'>Taxon tree node to add.</param>
 public void AddChild(TaxonTreeNode taxonTreeNode)
 {
     _children.Add(taxonTreeNode);
     taxonTreeNode.AddParent(this);
 }