Exemplo n.º 1
0
        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));
                        }
                    }
                }
            }
        }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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;
        }
Exemplo n.º 9
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;
        }
Exemplo n.º 10
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;
        }
Exemplo n.º 11
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;
        }
Exemplo n.º 12
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;
        }
Exemplo n.º 13
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;
        }
Exemplo n.º 14
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;
        }
Exemplo n.º 15
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;
        }