Exemplo n.º 1
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            this.Page.ClientScript.RegisterClientScriptResource(this.GetType(), "Colosoft.WebControls.Resources.SlideShow.slide.js");
            StringBuilder style = new StringBuilder("<style>\r\n");
            Style         navUl = new Style();

            style.Append("#" + this.ClientID + "_nav {").Append(NavigatorStyle.GetStyleAttributes(null).Value).Append("}").Append("\r\n").Append("#" + this.ClientID + "_nav ul {padding: 0px; margin: 3px 0px 0px 0px;}").Append("\r\n").Append("#" + this.ClientID + "_nav ul li { display: inline; float: left; list-style-type: none; margin: 0px; padding: 5px; }").Append("\r\n").Append("#" + this.ClientID + "_pic { margin-bottom: 3px; margin: 0px; width: ").Append(this.Width.ToString()).Append("; height: ").Append((int)(this.Height.Value - this.NavigatorStyle.Height.Value)).Append("px; }").Append("\r\n").Append("#" + this.ClientID + "_pic .img { border: 1px solid #999; padding: 3px; background: #eee; }").Append("\r\n").Append("#" + this.ClientID + "_items {visibility: hidden;}").Append("#" + this.ClientID + "_titleSlide {margin-top: 4px;}").Append("#" + this.ClientID + "_textSlide { margin-top: 6px; margin-bottom: 6px;}").Append("</style>");
            string scriptStartup = string.Format("<script>var {0} = new SlideShow(\"{0}\"); {0}.start();</script>", this.ClientID);

            this.Page.ClientScript.RegisterStartupScript(typeof(string), this.ClientID + "_script", scriptStartup);
            this.Page.ClientScript.RegisterClientScriptBlock(typeof(string), this.ClientID + "_cssStyle", style.ToString());
        }
Exemplo n.º 2
0
        /// <summary>
        /// 跟据菜单创建导航组件
        /// </summary>
        /// <param name="navBarControl">导航控件</param>
        /// <param name="mainMenu">主菜单</param>
        /// <param name="style">导航控件的自定义显示类型</param>
        public void CreateNavBarButtons(NavBarControl navBarControl, MenuStrip mainMenu, NavigatorStyle style)
        {
            //跟据用户选择样式创建不同类型的Navigator
            NavigatorBase creator;

            //支持两种策略
            if (NavigatorStyle.BarItem == style)
            {
                creator = new NavigatorBarList(this);
            }
            else
            {
                creator = new NavigatorTreeView(this);
            }

            navBarControl.BeginUpdate();
            creator.CreateNavigator(mainMenu, navBarControl);
            navBarControl.EndUpdate();
        }
Exemplo n.º 3
0
        /// <summary>
        /// 跟据菜单创建导航组件
        /// </summary>
        /// <param name="navBarControl">导航控件</param>
        /// <param name="mainMenu">主菜单</param>
        /// <param name="style">导航控件的自定义显示类型</param>
        public void CreateNavBarButtons(NavBarControl navBarControl, MenuStrip mainMenu, NavigatorStyle style)
        {
            //跟据用户选择样式创建不同类型的Navigator
            NavigatorBase creator;

            //支持两种策略
            if (NavigatorStyle.BarItem == style)
                creator = new NavigatorBarList(this);
            else
                creator = new NavigatorTreeView(this);

            navBarControl.BeginUpdate();
            creator.CreateNavigator(mainMenu, navBarControl);
            navBarControl.EndUpdate();
        }