コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ContentTypeCollection"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="list">The list.</param>
        public ContentTypeCollection([NotNull] SpContext context, [NotNull] BaseList list)
        {
            Assert.ArgumentNotNull(context, "context");
            Assert.ArgumentNotNull(list, "list");

            this.Connector = new ContentTypeCollectionConnector(context, list.WebUrl);
            this.Context   = context;
            this.List      = list;
        }
コード例 #2
0
        protected override List <ContentType> GetEntities()
        {
            if (this.Entities == null)
            {
                EntityValues contentTypeValuesCollection = new ContentTypeCollectionConnector(this.Context, this.List.WebUrl).GetContentTypes(this.List.ID);

                this.Entities = new List <ContentType>();
                foreach (EntityValues contentTypeValues in contentTypeValuesCollection["ContentTypes"])
                {
                    this.Entities.Add(new ContentType(contentTypeValues, this.List, this.Context));
                }
            }

            return(this.Entities);
        }