public List <LocalTermStore> FetchTermStores()
        {
            TaxonomySession taxonomySession = this.GetTaxonomySession();

            ClientConnectorDownloadOptions options = new ClientConnectorDownloadOptions();

            options.MaximumDepth          = 0;
            options.MinimalAtMaximumDepth = true;

            var retrievals = TermStoreDownloader.GetRetrievalsForMinimalProperties();

            this.clientContext.Load(taxonomySession, session => session.TermStores.Include(retrievals));

            this.ExecuteQuery();

            List <LocalTermStore> list = new List <LocalTermStore>();

            foreach (TermStore clientTermStore in taxonomySession.TermStores)
            {
                var downloaderContext = new TaxonomyItemDownloaderContext(this, options);
                TermStoreDownloader termStoreDownloader = new TermStoreDownloader(downloaderContext, clientTermStore);
                termStoreDownloader.AssignMinimalProperties();
                list.Add(termStoreDownloader.LocalObject);
            }

            return(list);
        }
        public void Download(LocalTermStore termStore, ClientConnectorDownloadOptions options = null)
        {
            if (options == null)
            {
                options = new ClientConnectorDownloadOptions();
            }

            TermStore clientTermStore = this.FetchClientTermStore(termStore.Id);

            // Load full data for the TermStore object
            var downloaderContext = new TaxonomyItemDownloaderContext(this, options);
            TermStoreDownloader termStoreDownloader = new TermStoreDownloader(downloaderContext, clientTermStore);

            termStoreDownloader.SetLocalObject(termStore);
            termStoreDownloader.FetchItem();
        }
Example #3
0
 internal TaxonomyItemDownloaderContext(Client15Connector clientConnector, ClientConnectorDownloadOptions options)
 {
     this.ClientConnector = clientConnector;
     this.Options         = options;
 }