protected override void QueryExtendedProperties() // abstract { var clientTermStore = this.DownloaderContext.TermStoreDownloader.ClientTermStore; int defaultLcid = clientTermStore.DefaultLanguage; this.SetClientWorkingLanguageToDefault(); this.ClientContext.Load(this.ClientTermSet, termSet => termSet.Contact, termSet => termSet.CustomSortOrder, termSet => termSet.Description, termSet => termSet.IsAvailableForTagging, termSet => termSet.IsOpenForTermCreation, termSet => termSet.Owner, termSet => termSet.CustomProperties, termSet => termSet.Stakeholders); using (this.ClientConnector.WorkingLanguageManager.StartUnmanagedScope(clientTermStore)) { this.localizedNameQueries = TermSetLocalizedNameQuery.Load( this.ClientTermSet, this.DownloaderContext.GetLcidsToRead(), defaultLcid, clientTermStore, this.ClientConnector ); } }
protected override bool OnProcessCheckExistence() { this.clientTermSet = null; this.localizedNameQueries = null; TermGroupUploader groupUploader = (TermGroupUploader)this.GetParentUploader(); if (!groupUploader.FoundClientObject) { this.WaitForBlocker(groupUploader); return(false); } Debug.Assert(groupUploader.ClientTermGroup != null); this.SetClientWorkingLanguageToDefault(); using (this.Controller.ClientConnector.WorkingLanguageManager.StartUnmanagedScope(this.ClientTermStore)) { this.exceptionHandlingScope = new ExceptionHandlingScope(this.ClientContext); using (this.exceptionHandlingScope.StartScope()) { using (this.exceptionHandlingScope.StartTry()) { if (this.FindByName) { CsomHelpers.FlushCachedProperties(groupUploader.ClientTermGroup.TermSets); this.clientTermSet = groupUploader.ClientTermGroup.TermSets .GetByName(this.localTermSet.Name); } else { // TODO: If "elsewhere" isn't needed, then we // can get this directly from groupUploader.ClientChildTermSets CsomHelpers.FlushCachedProperties(this.ClientTermStore); this.clientTermSet = this.ClientTermStore .GetTermSet(this.localTermSet.Id); } var conditionalScope = new ConditionalScope(this.ClientContext, () => this.clientTermSet.ServerObjectIsNull.Value, allowAllActions: true); using (conditionalScope.StartScope()) { using (conditionalScope.StartIfFalse()) { // TODO: If SyncAction.DeleteExtraChildItems==false, then we can skip this this.ClientContext.Load(this.clientTermSet, ts => ts.Id, ts => ts.Name, ts => ts.Group.Id, ts => ts.CustomProperties, ts => ts.Stakeholders, // For AssignClientChildItems() // TODO: We can sometimes skip this ts => ts.Terms.Include(t => t.Id) ); this.localizedNameQueries = TermSetLocalizedNameQuery.Load( this.clientTermSet, this.Controller.ClientLcids, this.Controller.DefaultLanguageLcid, this.ClientTermStore, this.Controller.ClientConnector ); } } } using (this.exceptionHandlingScope.StartCatch()) { } } } return(true); }