示例#1
0
        /// <summary>
        /// Get a list of fields to be deleted on the content type.
        /// </summary>
        /// <returns>The value of deleteField parameter.</returns>
        protected DeleteFieldsDefinition GenerateDeleteFieldsDefinition()
        {
            DeleteFieldsDefinition deleteFields = new DeleteFieldsDefinition();

            deleteFields.Fields               = new DeleteFieldsDefinitionMethod[1];
            deleteFields.Fields[0]            = new DeleteFieldsDefinitionMethod();
            deleteFields.Fields[0].Field      = new DeleteFieldDefinition();
            deleteFields.Fields[0].ID         = Guid.NewGuid().ToString();
            deleteFields.Fields[0].Field.Name = this.GenerateRandomString(10);

            return(deleteFields);
        }
示例#2
0
        /// <summary>
        /// This operation is used to update a content type on the context site.
        /// </summary>
        /// <param name="contentTypeId">contentTypeID is the ID of the content type to be updated.</param>
        /// <param name="contentTypeProperties">properties is the container for properties to set on the content type.</param>
        /// <param name="newFields">newFields is the container for a list of existing fields to be included in the content type.</param>
        /// <param name="updateFields">updateFields is the container for a list of fields to be updated on the content type.</param>
        /// <param name="deleteFields">deleteFields is the container for a list of fields to be updated on the content type.</param>
        /// <returns>The result of UpdateContentType.</returns>
        public UpdateContentTypeResponseUpdateContentTypeResult UpdateContentType(string contentTypeId, UpdateContentTypeContentTypeProperties contentTypeProperties, AddOrUpdateFieldsDefinition newFields, AddOrUpdateFieldsDefinition updateFields, DeleteFieldsDefinition deleteFields)
        {
            UpdateContentTypeResponseUpdateContentTypeResult result = new UpdateContentTypeResponseUpdateContentTypeResult();

            result = this.service.UpdateContentType(contentTypeId, contentTypeProperties, newFields, updateFields, deleteFields);

            this.ValidateUpdateContentType();
            this.CaptureTransportRelatedRequirements();

            return(result);
        }