SenseNet.ContentRepository.GenericContent.SetAllowedChildTypes C# (CSharp) Method

SetAllowedChildTypes() private method

private SetAllowedChildTypes ( IEnumerable contentTypes, bool throwOnError = true, bool save = false ) : void
contentTypes IEnumerable
throwOnError bool
save bool
return void
        private void SetAllowedChildTypes(IEnumerable<ContentType> contentTypes, bool throwOnError = true, bool save = false)
        {
            var currentTypes = this.AllowedChildTypes;
            if (currentTypes.Count() == 0)
                currentTypes = this.ContentType.AllowedChildTypes;
            var addList = contentTypes.Except(currentTypes);
            if (addList.Count() == 0)
                return;
            var list = currentTypes.Union(contentTypes).Distinct();
            this.AllowedChildTypes = list.ToArray();
            if (save)
                this.Save();
        }
        private Exception GetCannotAllowContentTypeException()