コード例 #1
0
        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();
        }
コード例 #2
0
ファイル: ContextMenu.cs プロジェクト: blairlearn/wcms-cde
        private void SetupStyle()
        {
            if (MenuStyle != ContextMenuStyle.None)
            {
                this.CssClass = "ctxMenu"
                                + " ctxMenu-" + MenuStyle.ToString();

                //Load stylesheets into the head block
                CssManager.AddResource(Page, typeof(ContextMenu), "NCI.Web.UI.WebControls.Menus.Resources.ContextMenu.CTXMenuBase.css");
                CssManager.AddResource(Page, typeof(ContextMenu), string.Format("NCI.Web.UI.WebControls.Menus.Resources.ContextMenu.{0}.css", MenuStyle.ToString()));
            }
        }
コード例 #3
0
ファイル: MenuBar.cs プロジェクト: blairlearn/wcms-cde
        private void SetupStyle()
        {
            if (MenuStyle != MenuStyles.None)
            {
                if (Page.Header == null)
                {
                    throw new NullReferenceException("The head html element for the page requires the runat=server property.");
                }

                this.CssClass = "MBMenu"
                                + " MBMenu-" + MenuStyle.ToString();

                if (!HttpContext.Current.Items.Contains("MBMenuBase"))
                {
                    HtmlLink link = new HtmlLink();

                    Page.Header.Controls.Add(link);

                    link.Href = Page.ClientScript.GetWebResourceUrl(
                        typeof(MenuBar),
                        "NCI.Web.UI.WebControls.Menus.Resources.MenuBar.MBMenuBase.css");

                    link.Attributes.Add("rel", "stylesheet");



                    //Mark that the stylesheet has been added so no other
                    //context menus will add this...
                    HttpContext.Current.Items.Add("MBMenuBase", true);
                }

                //If we have not added the stylesheet for this style to the
                //Head block for this request then add it
                if (!HttpContext.Current.Items.Contains(MenuStyle))
                {
                    HtmlLink link = new HtmlLink();
                    Page.Header.Controls.Add(link);

                    link.Href = Page.ClientScript.GetWebResourceUrl(
                        typeof(MenuBar),
                        string.Format("NCI.Web.UI.WebControls.Menus.Resources.MenuBar.{0}.css", MenuStyle.ToString()));

                    link.Attributes.Add("rel", "stylesheet");



                    //Mark that the stylesheet has been added so no other
                    //context menus will add this...
                    HttpContext.Current.Items.Add(MenuStyle, true);
                }
            }
        }