protected override void ProcessRecord()
        {
            base.ProcessRecord();
            var ctx = base.Context;

            if (Identity != null)
            {
                var termSet = new SPOTermSet(Identity.Read());
                WriteObject(termSet);
            }
            else
            {
                TaxonomySession ts = TaxonomySession.GetTaxonomySession(ctx);
                var termStores = ts.TermStores;
                ctx.Load(termStores);
                ctx.ExecuteQuery();

                foreach (TermStore termStore in termStores)
                {
                    var groups = termStore.Groups;
                    ctx.Load(groups);
                    ctx.ExecuteQuery();
                    foreach (var group in groups)
                    {
                        var termSets = group.TermSets;
                        ctx.Load(termSets);
                        ctx.ExecuteQuery();
                        foreach (var termSet in termSets)
                        {
                            WriteObject(new SPOTermSet(termSet));
                        }
                    }
                }
            }
        }
Exemple #2
0
        //public LabelCollection Labels { get; }


        public override void Refresh()
        {
            _term.RefreshLoad();
            _term.Context.ExecuteQuery();
            base.Refresh();

            _reusedTerms      = null;
            _pinSourceTermSet = null;
            _sourceTerm       = null;
            _parentTerm       = null;
            _termSets         = null;
            _termSet          = null;
            _labels           = null;
        }
Exemple #3
0
        public SPOTermSet GetKeywordsTermSet()
        {
            if (_keywordsTermSet != null)
            {
                return(_keywordsTermSet);
            }

            var keywordsTermSet = _termStore.KeywordsTermSet;

            _termStore.Context.Load(keywordsTermSet);
            _termStore.Context.ExecuteQuery();

            _keywordsTermSet = new SPOTermSet(keywordsTermSet);
            return(_keywordsTermSet);
        }
Exemple #4
0
        public SPOTermSet GetOrphanedTermsTermSet()
        {
            if (_orphanedTermsTermSet != null)
            {
                return(_orphanedTermsTermSet);
            }

            var orphanedTermsTermSet = _termStore.OrphanedTermsTermSet;

            _termStore.Context.Load(orphanedTermsTermSet);
            _termStore.Context.ExecuteQuery();

            _orphanedTermsTermSet = new SPOTermSet(orphanedTermsTermSet);
            return(_orphanedTermsTermSet);
        }
Exemple #5
0
        public SPOTermSet GetHashTagsTermSet()
        {
            if (_hashTagsTermSet != null)
            {
                return(_hashTagsTermSet);
            }

            var hashTagsTermSet = _termStore.HashTagsTermSet;

            _termStore.Context.Load(hashTagsTermSet);
            _termStore.Context.ExecuteQuery();

            _hashTagsTermSet = new SPOTermSet(hashTagsTermSet);
            return(_hashTagsTermSet);
        }
Exemple #6
0
        public SPOTermSet GetPinSourceTermSet()
        {
            if (_pinSourceTermSet != null)
            {
                return(_pinSourceTermSet);
            }

            var pinSourceTermSet = _term.PinSourceTermSet;

            _term.Context.Load(pinSourceTermSet);
            _term.Context.ExecuteQuery();

            _pinSourceTermSet = new SPOTermSet(pinSourceTermSet);
            return(_pinSourceTermSet);
        }
Exemple #7
0
        public SPOTermSet GetTermSet()
        {
            if (_termSet != null)
            {
                return(_termSet);
            }

            var termSet = _term.TermSet;

            _term.Context.Load(termSet);
            _term.Context.ExecuteQuery();

            _termSet = new SPOTermSet(termSet);
            return(_termSet);
        }
Exemple #8
0
        public virtual void Refresh()
        {
            _termStore.RefreshLoad();
            _termStore.Context.ExecuteQuery();

            if (_termStore.IsPropertyAvailable("DefaultLanguage"))
            {
                SetProp("DefaultLanguage", _termStore.DefaultLanguage, false);
            }
            if (_termStore.IsPropertyAvailable("WorkingLanguage"))
            {
                SetProp("WorkingLanguage", _termStore.WorkingLanguage, false);
            }

            _systemGroup          = null;
            _groups               = null;
            _hashTagsTermSet      = null;
            _orphanedTermsTermSet = null;
            _keywordsTermSet      = null;
        }
        public virtual void Refresh()
        {
            _termStore.RefreshLoad();
            _termStore.Context.ExecuteQuery();

            if (_termStore.IsPropertyAvailable("DefaultLanguage"))
                SetProp("DefaultLanguage", _termStore.DefaultLanguage, false);
            if (_termStore.IsPropertyAvailable("WorkingLanguage"))
                SetProp("WorkingLanguage", _termStore.WorkingLanguage, false);

            _systemGroup = null;
            _groups = null;
            _hashTagsTermSet = null;
            _orphanedTermsTermSet = null;
            _keywordsTermSet = null;
        }
        public SPOTermSet GetOrphanedTermsTermSet()
        {
            if (_orphanedTermsTermSet != null) return _orphanedTermsTermSet;

            var orphanedTermsTermSet = _termStore.OrphanedTermsTermSet;
            _termStore.Context.Load(orphanedTermsTermSet);
            _termStore.Context.ExecuteQuery();

            _orphanedTermsTermSet = new SPOTermSet(orphanedTermsTermSet);
            return _orphanedTermsTermSet;
        }
        public SPOTermSet GetKeywordsTermSet()
        {
            if (_keywordsTermSet != null) return _keywordsTermSet;

            var keywordsTermSet = _termStore.KeywordsTermSet;
            _termStore.Context.Load(keywordsTermSet);
            _termStore.Context.ExecuteQuery();

            _keywordsTermSet = new SPOTermSet(keywordsTermSet);
            return _keywordsTermSet;
        }
        public SPOTermSet GetHashTagsTermSet()
        {
            if (_hashTagsTermSet != null) return _hashTagsTermSet;

            var hashTagsTermSet = _termStore.HashTagsTermSet;
            _termStore.Context.Load(hashTagsTermSet);
            _termStore.Context.ExecuteQuery();

            _hashTagsTermSet = new SPOTermSet(hashTagsTermSet);
            return _hashTagsTermSet;
        }
        //public LabelCollection Labels { get; }
        public override void Refresh()
        {
            _term.RefreshLoad();
            _term.Context.ExecuteQuery();
            base.Refresh();

            _reusedTerms = null;
            _pinSourceTermSet = null;
            _sourceTerm = null;
            _parentTerm = null;
            _termSets = null;
            _termSet = null;
            _labels = null;
        }
        public SPOTermSet GetTermSet()
        {
            if (_termSet != null) return _termSet;

            var termSet = _term.TermSet;
            _term.Context.Load(termSet);
            _term.Context.ExecuteQuery();

            _termSet = new SPOTermSet(termSet);
            return _termSet;
        }
        public SPOTermSet GetPinSourceTermSet()
        {
            if (_pinSourceTermSet != null) return _pinSourceTermSet;

            var pinSourceTermSet = _term.PinSourceTermSet;
            _term.Context.Load(pinSourceTermSet);
            _term.Context.ExecuteQuery();

            _pinSourceTermSet = new SPOTermSet(pinSourceTermSet);
            return _pinSourceTermSet;
        }