/// <summary> /// Class constructor /// </summary> public AvalonDockViewProperties() { DocumentHeaderTemplate = null; LayoutInitializer = new LayoutInitializer(); SelectPanesStyle = new PanesStyleSelector(); SelectPanesTemplate = new PanesTemplateSelector(); }
public async Task <IActionResult> Index() { await LayoutInitializer.FillCategories(db, ViewBag); List <News> popular_news = await db.News .OrderByDescending(n => n.ViewCount) .Take(10) .Include(n => n.SubCategory) .ThenInclude(s => s.Category) .ToListAsync(); List <News> latest_news = await db.News .OrderByDescending(n => n.CreatedDate) .Take(5) .Include(n => n.SubCategory) .ThenInclude(s => s.Category) .ToListAsync(); List <News> slider_news = new List <News>(); List <Category> categories = await db.Categories.ToListAsync(); foreach (var category in categories) { var news = await db.News.OrderByDescending(n => n.CreatedDate) .Where(n => n.SubCategory.Category.Id == category.Id) .Include(n => n.SubCategory) .ThenInclude(s => s.Category) .FirstOrDefaultAsync(); if (news != null) { slider_news.Add(news); } } List <NewsPhoto> photos = await db.NewsPhotos.ToListAsync(); HomeModel model = new HomeModel() { PopularNews = popular_news, LatestNews = latest_news, SliderNews = slider_news, NewsPhotos = photos, Tags = await db.Tags.ToListAsync(), MostCommenteds = await db.News.OrderByDescending(n => n.Comments.Count).Take(5).ToListAsync() }; return(View(model)); }
/// <summary> /// Handles the Initialized event of the Bootstrapper. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="Sitefinity.Data.ExecutedEventArgs"/> instance containing the event data.</param> protected virtual void Bootstrapper_Initialized(object sender, ExecutedEventArgs e) { if (e.CommandName == "Bootstrapped") { this.RegisterFileObservers(); var controllerInitializer = new ControllerInitializer(); controllerInitializer.Initialize(); var layoutsInitializer = new LayoutInitializer(); layoutsInitializer.Initialize(); var gridSystemInitializer = new GridSystemInitializer(); gridSystemInitializer.Initialize(); var designerInitializer = new DesignerInitializer(); designerInitializer.Initialize(); this.RegisterScripts(); } }
/// <summary> /// Handles the Initialized event of the Bootstrapper. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="Sitefinity.Data.ExecutedEventArgs"/> instance containing the event data.</param> protected virtual void Bootstrapper_Initialized(object sender, ExecutedEventArgs e) { if (e.CommandName == "Bootstrapped") { var resourcesInitializer = new ResourcesInitializer(); resourcesInitializer.Initialize(); var fileMonitoringInitilizer = new FileMonitoringInitializer(); fileMonitoringInitilizer.Initialize(); var controllerContainerInitializer = new ControllerContainerInitializer(); controllerContainerInitializer.Initialize(this.controllerAssemblies); this.controllerAssemblies = null; // We won't be needing those anymore. Set them free. var layoutsInitializer = new LayoutInitializer(); layoutsInitializer.Initialize(); var designerInitializer = new DesignerInitializer(); designerInitializer.Initialize(); ObjectFactory.Container.RegisterType <ICommentNotificationsStrategy, Telerik.Sitefinity.Frontend.Modules.Comments.ReviewNotificationStrategy>(new ContainerControlledLifetimeManager()); } }
/// <summary> /// Handles the Initialized event of the Bootstrapper. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="Sitefinity.Data.ExecutedEventArgs"/> instance containing the event data.</param> protected virtual void Bootstrapper_Initialized(object sender, ExecutedEventArgs e) { if (e.CommandName == "Bootstrapped") { var resourcesInitializer = new ResourcesInitiliazer(); resourcesInitializer.Initialize(); var fileMonitoringInitilizer = new FileMonitoringInitializer(); fileMonitoringInitilizer.Initialize(); var controllerContainerInitializer = new ControllerContainerInitializer(); controllerContainerInitializer.Initialize(); var layoutsInitializer = new LayoutInitializer(); layoutsInitializer.Initialize(); var gridSystemInitializer = new GridSystemInitializer(); gridSystemInitializer.Initialize(); var designerInitializer = new DesignerInitializer(); designerInitializer.Initialize(); } }
private void MinimizeLayout(object sender, RoutedEventArgs e) { var layout = new LayoutInitializer(); layout.RestoreLayout(Docking.Layout); }
public async Task <IActionResult> Register() { await LayoutInitializer.FillCategories(_db, ViewBag); return(View()); }