Example #1
0
        public UploadController(Client15Connector clientConnector, LocalTermStore localTermStore,
                                TermStore clientTermStore, ClientConnectorUploadOptions options)
        {
            this.clientConnector = clientConnector;
            this.localTermStore  = localTermStore;
            this.clientTermStore = clientTermStore;
            this.options         = options;

            this.queuedUploaders = new PriorityQueue <TaxonomyItemUploader>(new TaxonomyItemUploaderComparer());
        }
Example #2
0
 internal TaxonomyItemDownloaderContext(Client15Connector clientConnector, ClientConnectorDownloadOptions options)
 {
     this.ClientConnector = clientConnector;
     this.Options         = options;
 }
Example #3
0
        /// <remarks>
        /// This method is sometimes called inside a CSOM execution scope, so it
        /// has to use SetUnmanagedWorkingLanguageForTermStore().  The caller must
        /// set up an unmanaged scope using WorkingLanguageManager.StartUnmanagedScope().
        /// </remarks>
        public static List <TermSetLocalizedNameQuery> Load(TermSet clientTermSet,
                                                            IEnumerable <int> lcidsToRead, int defaultLcid,
                                                            TermStore clientTermStore, Client15Connector clientConnector)
        {
            var clientContext = clientConnector.ClientContext;

            var list = new List <TermSetLocalizedNameQuery>();

            foreach (int lcid in lcidsToRead)
            {
                if (lcid == defaultLcid)
                {
                    continue; // we already read this as clientTermSet.Name
                }
                clientConnector.WorkingLanguageManager
                .SetUnmanagedWorkingLanguageForTermStore(clientTermStore, lcid);

                var localizedNameQuery = new TermSetLocalizedNameQuery();
                // Since we want to read just one property, which is a property that we already
                // read in the same ExecuteQuery() transaction, we need to construct a separate
                // CSOM object to hold the result.
                // (This apparently causes the Id/Name to get refetched a second time
                // by QueryChildObjects().)
                localizedNameQuery.ClientTermSet = new TermSet(clientContext, clientTermSet.Path);
                localizedNameQuery.Lcid          = lcid;

                clientContext.Load(localizedNameQuery.ClientTermSet, ts => ts.Name);

                list.Add(localizedNameQuery);
            }

            return(list);
        }