static void Main(string[] args)
        {
            string           userName   = "******";
            string           password   = "******";
            string           siteUrl    = "https://tenant.sharepoint.com/sites/yoursite";
            HeaderLayout     layout     = HeaderLayout.Standard;
            HeaderBackground background = HeaderBackground.Darker;
            MenuStyle        menuStyle  = MenuStyle.Cascading;

            try
            {
                ChangeTheLookOptionsHelper.ChangeHeaderLayout(siteUrl, layout, userName, password);
                Console.WriteLine($"Header Layout changed to {layout.ToString()} for {siteUrl}.");

                ChangeTheLookOptionsHelper.ChangeHeaderBackground(siteUrl, background, userName, password);
                Console.WriteLine($"Header Background changed to {background.ToString()} for {siteUrl}.");

                ChangeTheLookOptionsHelper.ChangeMenuStyle(siteUrl, menuStyle, userName, password);
                Console.WriteLine($"Menu Style changed to {menuStyle.ToString()} for {siteUrl}.");
            }
            catch (Exception ex)
            {
                Console.WriteLine("There was an error " + ex.Message);
            }
            Console.WriteLine("Press any key to exit.");
            Console.ReadLine();
        }
 internal static void ChangeHeaderBackground(string siteUrl, HeaderBackground background, string userName, string password)
 {
     using (var client = new SPHttpClient(new Uri(siteUrl), userName, password))
     {
         var itemPayload = new { __metadata = new { type = "SP.Web" }, HeaderEmphasis = background };
         var endpointUrl = string.Format("{0}/_api/web", siteUrl);
         var data        = client.ExecuteJson(endpointUrl, HttpMethod.Post, itemPayload);
     }
 }
Exemple #3
0
        void ReleaseDesignerOutlets()
        {
            if (BackButton != null)
            {
                BackButton.Dispose();
                BackButton = null;
            }

            if (BottomConstraint != null)
            {
                BottomConstraint.Dispose();
                BottomConstraint = null;
            }

            if (DistanceText != null)
            {
                DistanceText.Dispose();
                DistanceText = null;
            }

            if (EditSelf != null)
            {
                EditSelf.Dispose();
                EditSelf = null;
            }

            if (EditSelfBack != null)
            {
                EditSelfBack.Dispose();
                EditSelfBack = null;
            }

            if (EditSelfHeader != null)
            {
                EditSelfHeader.Dispose();
                EditSelfHeader = null;
            }

            if (EditSpacer != null)
            {
                EditSpacer.Dispose();
                EditSpacer = null;
            }

            if (HeaderBackground != null)
            {
                HeaderBackground.Dispose();
                HeaderBackground = null;
            }

            if (HideButton != null)
            {
                HideButton.Dispose();
                HideButton = null;
            }

            if (LastActiveDate != null)
            {
                LastActiveDate.Dispose();
                LastActiveDate = null;
            }

            if (LikeButton != null)
            {
                LikeButton.Dispose();
                LikeButton = null;
            }

            if (LocationTime != null)
            {
                LocationTime.Dispose();
                LocationTime = null;
            }

            if (MapBottomSeparator != null)
            {
                MapBottomSeparator.Dispose();
                MapBottomSeparator = null;
            }

            if (MapSatellite != null)
            {
                MapSatellite.Dispose();
                MapSatellite = null;
            }

            if (MapStreet != null)
            {
                MapStreet.Dispose();
                MapStreet = null;
            }

            if (MapTopSeparator != null)
            {
                MapTopSeparator.Dispose();
                MapTopSeparator = null;
            }

            if (MenuBlock != null)
            {
                MenuBlock.Dispose();
                MenuBlock = null;
            }

            if (MenuContainer != null)
            {
                MenuContainer.Dispose();
                MenuContainer = null;
            }

            if (MenuIcon != null)
            {
                MenuIcon.Dispose();
                MenuIcon = null;
            }

            if (MenuLayer != null)
            {
                MenuLayer.Dispose();
                MenuLayer = null;
            }

            if (MenuReport != null)
            {
                MenuReport.Dispose();
                MenuReport = null;
            }

            if (Name != null)
            {
                Name.Dispose();
                Name = null;
            }

            if (NavigationSpacer != null)
            {
                NavigationSpacer.Dispose();
                NavigationSpacer = null;
            }

            if (NextButton != null)
            {
                NextButton.Dispose();
                NextButton = null;
            }

            if (PercentProgress != null)
            {
                PercentProgress.Dispose();
                PercentProgress = null;
            }

            if (PreviousButton != null)
            {
                PreviousButton.Dispose();
                PreviousButton = null;
            }

            if (ProfileImageContainer != null)
            {
                ProfileImageContainer.Dispose();
                ProfileImageContainer = null;
            }

            if (ProfileImageScroll != null)
            {
                ProfileImageScroll.Dispose();
                ProfileImageScroll = null;
            }

            if (ProfileViewDescription != null)
            {
                ProfileViewDescription.Dispose();
                ProfileViewDescription = null;
            }

            if (ProfileViewMap != null)
            {
                ProfileViewMap.Dispose();
                ProfileViewMap = null;
            }

            if (ProfileViewScroll != null)
            {
                ProfileViewScroll.Dispose();
                ProfileViewScroll = null;
            }

            if (RegisterDate != null)
            {
                RegisterDate.Dispose();
                RegisterDate = null;
            }

            if (ResponseRate != null)
            {
                ResponseRate.Dispose();
                ResponseRate = null;
            }

            if (RippleImageNext != null)
            {
                RippleImageNext.Dispose();
                RippleImageNext = null;
            }

            if (RippleImagePrev != null)
            {
                RippleImagePrev.Dispose();
                RippleImagePrev = null;
            }

            if (RippleProfileView != null)
            {
                RippleProfileView.Dispose();
                RippleProfileView = null;
            }

            if (RoundBottom != null)
            {
                RoundBottom.Dispose();
                RoundBottom = null;
            }

            if (ScrollBottomConstraint != null)
            {
                ScrollBottomConstraint.Dispose();
                ScrollBottomConstraint = null;
            }

            if (SendLocation != null)
            {
                SendLocation.Dispose();
                SendLocation = null;
            }

            if (Snackbar != null)
            {
                Snackbar.Dispose();
                Snackbar = null;
            }

            if (SnackBottomConstraint != null)
            {
                SnackBottomConstraint.Dispose();
                SnackBottomConstraint = null;
            }

            if (SnackTopConstraint != null)
            {
                SnackTopConstraint.Dispose();
                SnackTopConstraint = null;
            }

            if (Username != null)
            {
                Username.Dispose();
                Username = null;
            }

            if (ViewportConstraint != null)
            {
                ViewportConstraint.Dispose();
                ViewportConstraint = null;
            }
        }