Item that is used to map samples to tree that supports sub nodes
        /// <summary>
        /// Gets all samples in a list grouped by main category. All sub-categories are flattened.
        /// </summary>
        /// <returns>Return all categories and samples</returns>
        public List<TreeItem> GetSamplesInCategories()
        {
            var categories = new List<TreeItem>();

            foreach (var category in _sampleStructureMap.Categories)
            {
                var categoryItem = new TreeItem();
                categoryItem.Name = category.Name;

                foreach (var subCategory in category.SubCategories)
                {
                    foreach (var sample in subCategory.Samples)
                        categoryItem.Items.Add(sample);
                }

                categories.Add(categoryItem);
            }
            return categories;
        }
        /// <summary>
        /// Gets all samples as a tree.
        /// </summary>
        /// <returns>Return all categories, subcategories and samples.</returns>
        public List<TreeItem> GetSamplesAsTree()
        {
            var categories = new List<TreeItem>();

            foreach (var category in _sampleStructureMap.Categories)
            {
                var categoryItem = new TreeItem { Name = category.Name };

                foreach (var subCategory in category.SubCategories)
                {
                    if (subCategory.ShowGroup)
                    {
                        var subCategoryItem = new TreeItem() { Name = subCategory.Name };
                        categoryItem.Items.Add(subCategoryItem);

                        if (subCategory.Samples != null)
                            foreach (var sample in subCategory.Samples)
                                subCategoryItem.Items.Add(sample);
                    }
                    else
                    {
                        foreach (var sample in subCategory.Samples)
                            categoryItem.Items.Add(sample);
                    }
                }

                categories.Add(categoryItem);
            }
            return categories;
        }