using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.SharePoint; using Microsoft.SharePoint.Taxonomy; using System.Collections.ObjectModel; namespace TaxonomyCodeSamples {
class Program
{
static void Main(string[] args)
{ using
(SPSite site = new SPSite("http://c4968397007/")) { TaxonomySession taxSession = new TaxonomySession(site); //// Get the term store TermStore termStore = taxSession.TermStores["MMS"]; //// Loop through all the groups in the
term store foreach (Group group in
termStore.Groups) { //// Check whether the group
is a site collection group if
(group.IsSiteCollectionGroup) { //// Display the name of the
group
Console.WriteLine(group.Name + " is a Site Collection Group"); break;
} } Console.ReadLine(); }
}
} }
|