コード例 #1
0
 public void ApplyMasterPage(SPWeb currentWeb, string masterPath, string customMasterPath)
 {
     SPWeb rootWeb = currentWeb.Site.RootWeb;
     Uri masterUri = new SPUrl(rootWeb, masterPath).AbsoluteUrl;
     Uri customUri = new SPUrl(rootWeb, customMasterPath).AbsoluteUrl;
     UpdateWebMasterPages(currentWeb, masterUri, customUri);
 }
コード例 #2
0
ファイル: MasterPageHelper.cs プロジェクト: ssrisunt/dynamite
        /// <summary>
        /// Reverts the master page url of all the web in a site to Seattle.
        /// </summary>
        /// <param name="site">The site containing all the web to update.</param>
        public void RevertToSeattle(SPSite site)
        {
            var masterPageFile       = this.GetSiteRelativeMasterPageUrl(site, this.seattleMasterPageFileName);
            var seattleMasterPageUri = new SPUrl(site.RootWeb, masterPageFile.Url).AbsoluteUrl;

            UpdateMasterPages(site, seattleMasterPageUri, seattleMasterPageUri);
        }
コード例 #3
0
ファイル: MasterPageHelper.cs プロジェクト: ssrisunt/dynamite
        /// <summary>
        /// Applies the master page url on all the web of a site.
        /// </summary>
        /// <param name="site">The web to update.</param>
        /// <param name="systemMasterPageFileName">System MasterPage filename</param>
        /// <param name="publishingMasterPageFileName">Publishing MasterPage filename</param>
        public void ApplyRootMasterPage(SPSite site, string systemMasterPageFileName, string publishingMasterPageFileName)
        {
            Uri systemMasterPageUri     = null;
            Uri publishingMasterPageUri = null;

            if (!string.IsNullOrEmpty(systemMasterPageFileName))
            {
                systemMasterPageUri = new SPUrl(site.RootWeb, this.GetSiteRelativeMasterPageUrl(site, systemMasterPageFileName).Url).AbsoluteUrl;
            }

            if (!string.IsNullOrEmpty(publishingMasterPageFileName))
            {
                publishingMasterPageUri = new SPUrl(site.RootWeb, this.GetSiteRelativeMasterPageUrl(site, publishingMasterPageFileName).Url).AbsoluteUrl;
            }

            UpdateMasterPages(site, systemMasterPageUri, publishingMasterPageUri);
        }
コード例 #4
0
        /// <summary>
        /// Applies the master page url on all the web of a site.
        /// </summary>
        /// <param name="site">The web to update.</param>
        /// <param name="systemMasterPageFileName">System MasterPage filename</param>
        /// <param name="publishingMasterPageFileName">Publishing MasterPage filename</param>
        public void ApplyRootMasterPage(SPSite site, string systemMasterPageFileName, string publishingMasterPageFileName)
        {
            Uri systemMasterPageUri = null;
            Uri publishingMasterPageUri = null;

            if (!string.IsNullOrEmpty(systemMasterPageFileName))
            {
                systemMasterPageUri = new SPUrl(site.RootWeb, this.GetSiteRelativeMasterPageUrl(site, systemMasterPageFileName).Url).AbsoluteUrl;
            }

            if (!string.IsNullOrEmpty(publishingMasterPageFileName))
            {
                publishingMasterPageUri = new SPUrl(site.RootWeb, this.GetSiteRelativeMasterPageUrl(site, publishingMasterPageFileName).Url).AbsoluteUrl;
            }

            UpdateMasterPages(site, systemMasterPageUri, publishingMasterPageUri);
        }
コード例 #5
0
 /// <summary>
 /// Reverts the master page url of all the web in a site to Seattle.
 /// </summary>
 /// <param name="site">The site containing all the web to update.</param>
 public void RevertToSeattle(SPSite site)
 {
     var masterPageFile = this.GetSiteRelativeMasterPageUrl(site, this.seattleMasterPageFileName);
     var seattleMasterPageUri = new SPUrl(site.RootWeb, masterPageFile.Url).AbsoluteUrl;
     UpdateMasterPages(site, seattleMasterPageUri, seattleMasterPageUri);
 }
コード例 #6
0
 public void RevertToDefaultMasterPage(SPWeb currentWeb, string originalMasterPath)
 {
     SPWeb rootWeb = currentWeb.Site.RootWeb;
     Uri masterUri = new SPUrl(rootWeb, originalMasterPath).AbsoluteUrl;
     UpdateWebMasterPages(currentWeb, masterUri, masterUri);
 }