예제 #1
0
        /// <summary>
        /// Updates the view HTML to include the web part zone layout the user selected.
        /// </summary>
        /// <param name="listToCreateViewOn">The list to create view on.</param>
        /// <param name="selectedLayout">The selected layout.</param>
        /// <param name="view">The view.</param>
        private static void UpdateViewHtmlAndSave(SPList listToCreateViewOn, string selectedLayout, SPView view)
        {
            var viewAspxFile = listToCreateViewOn.GetViewFile(view);
            var fileContents = viewAspxFile.GetContents();

            var fileContentsWithEpmLiveWebPartTag = AddEpmLiveWebPartTagToTopOfContents(fileContents);
            var viewContent         = GetViewContentBasedOnLayoutType(selectedLayout);
            var updatedFileContents = InsertViewContentIntoContentPlaceHolder(fileContentsWithEpmLiveWebPartTag, viewContent);

            viewAspxFile.UpdateContentsAndSave(updatedFileContents);
        }