コード例 #1
0
 internal static void ChangeHeaderLayout(string siteUrl, HeaderLayout layout, string userName, string password)
 {
     using (var client = new SPHttpClient(new Uri(siteUrl), userName, password))
     {
         var itemPayload = new { __metadata = new { type = "SP.Web" }, HeaderLayout = layout };
         var endpointUrl = string.Format("{0}/_api/web", siteUrl);
         var data        = client.ExecuteJson(endpointUrl, HttpMethod.Post, itemPayload);
     }
 }
コード例 #2
0
        internal static void ChangeMenuStyle(string siteUrl, MenuStyle menuStyle, string userName, string password)
        {
            bool megaMenuEnabled = menuStyle == MenuStyle.Megamenu ? true : false;

            using (var client = new SPHttpClient(new Uri(siteUrl), userName, password))
            {
                var itemPayload = new { __metadata = new { type = "SP.Web" }, MegaMenuEnabled = megaMenuEnabled };
                var endpointUrl = string.Format("{0}/_api/web", siteUrl);
                var data        = client.ExecuteJson(endpointUrl, HttpMethod.Post, itemPayload);
            }
        }