private static List<string> CollectHierarchicalTags(List<Term> terms)
{
Func<List<Term>, List<string>, List<string>> collectTagsFunc = null;
collectTagsFunc = (ts, tags) =>
{
if (ts != null && ts.Count > 0)
{
foreach (var t in ts)
{
tags.Add(t.Name);
tags.AddRange(collectTagsFunc(t.ChildTerms, new List<string>()));
}
}
return tags;
};
return collectTagsFunc(terms, new List<string>());
}