コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MenuClientEventsBuilder"/> class.
        /// </summary>
        /// <param name="clientEvents">The client events.</param>
        /// <param name="viewContext">The view context.</param>
        public MenuClientEventsBuilder(MenuClientEvents clientEvents, ViewContext viewContext)
        {
            Guard.IsNotNull(clientEvents, "clientEvents");
            Guard.IsNotNull(viewContext, "viewContext");

            this.clientEvents = clientEvents;
            this.viewContext = viewContext;
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MenuClientEventsBuilder"/> class.
        /// </summary>
        /// <param name="clientEvents">The client events.</param>
        /// <param name="viewContext">The view context.</param>
        public MenuClientEventsBuilder(MenuClientEvents clientEvents, ViewContext viewContext)
        {
            Guard.IsNotNull(clientEvents, "clientEvents");
            Guard.IsNotNull(viewContext, "viewContext");

            this.clientEvents = clientEvents;
            this.viewContext  = viewContext;
        }
コード例 #3
0
ファイル: Menu.cs プロジェクト: hazzik/telerikaspnetmvc
        public Menu(ViewContext viewContext, IClientSideObjectWriterFactory clientSideObjectWriterFactory, IUrlGenerator urlGenerator, INavigationItemAuthorization authorization, INavigationComponentHtmlBuilderFactory <Menu, MenuItem> factory)
            : base(viewContext, clientSideObjectWriterFactory)
        {
            Guard.IsNotNull(urlGenerator, "urlGenerator");
            Guard.IsNotNull(authorization, "authorization");
            Guard.IsNotNull(factory, "factory");

            UrlGenerator    = urlGenerator;
            Authorization   = authorization;
            rendererFactory = factory;

            ClientEvents = new MenuClientEvents();

            ScriptFileNames.AddRange(new[] { "telerik.common.js", "telerik.menu.js" });

            this.Effects = new Effects();
            defaultEffects.Each(el => Effects.Container.Add(el));

            Items = new LinkedObjectCollection <MenuItem>(null);

            SelectedIndex = -1;
            HighlightPath = true;
        }