コード例 #1
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            var ctx = base.Context;

            if (Identity != null)
            {
                var group = new SPOTermGroup(Identity.Read());
                WriteObject(group);
            }
            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)
                    {
                        WriteObject(new SPOTermGroup(group));
                    }
                }
            }
        }
コード例 #2
0
        public SPOTermGroup GetGroup()
        {
            if (_termGroup != null)
            {
                return(_termGroup);
            }

            TermGroup group = _termSet.Group;

            _termSet.Context.Load(group);
            _termSet.Context.ExecuteQuery();
            _termGroup = new SPOTermGroup(group);
            return(_termGroup);
        }
コード例 #3
0
        public SPOTermGroup GetSystemGroup()
        {
            if (_systemGroup != null)
            {
                return(_systemGroup);
            }

            var systemGroup = _termStore.SystemGroup;

            if (!_termStore.IsObjectPropertyInstantiated("SystemGroup"))
            {
                _termStore.Context.Load(systemGroup);
                _termStore.Context.ExecuteQuery();
            }
            _systemGroup = new SPOTermGroup(systemGroup);
            return(_systemGroup);
        }
コード例 #4
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;
        }
コード例 #5
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;
        }
コード例 #6
0
        public SPOTermGroup GetSystemGroup()
        {
            if (_systemGroup != null) return _systemGroup;

            var systemGroup = _termStore.SystemGroup;
            if (!_termStore.IsObjectPropertyInstantiated("SystemGroup"))
            {
                _termStore.Context.Load(systemGroup);
                _termStore.Context.ExecuteQuery();
            }
            _systemGroup = new SPOTermGroup(systemGroup);
            return _systemGroup;
        }
コード例 #7
0
        public SPOTermGroup GetGroup()
        {
            if (_termGroup != null) return _termGroup;

            TermGroup group = _termSet.Group;
            _termSet.Context.Load(group);
            _termSet.Context.ExecuteQuery();
            _termGroup = new SPOTermGroup(group);
            return _termGroup;
        }
コード例 #8
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            var ctx = base.Context;

            var group = new SPOTermGroup(Group.Read());
            WriteObject(group.CreateTermSet(Name, Id, LCID, Contact, Description, CustomSortOrder, IsAvailableForTagging, Owner, IsOpenForTermCreation));
        }