public WidgetViewComponent(FujiyBlogDatabase db, WidgetSettingRepository widgetSettingRepository) { this.db = db; this.widgetSettingRepository = widgetSettingRepository; if (widgets == null) { var diretorio = new DirectoryInfo(Path.Combine(PlatformServices.Default.Application.ApplicationBasePath, "Views", "Shared", "Components", "Widget")); widgets = (from file in diretorio.GetFiles() let fileWithoutExtension = Path.GetFileNameWithoutExtension(file.FullName) where fileWithoutExtension != "Index" && fileWithoutExtension != "Widget" && !fileWithoutExtension.EndsWith("Edit") select fileWithoutExtension).ToArray(); } }
public WidgetViewComponent(FujiyBlogDatabase db, WidgetSettingRepository widgetSettingRepository) { this.db = db; this.widgetSettingRepository = widgetSettingRepository; if (widgets == null || widgets.Length == 0) { var widgetsViews = CompiledViewsHelper.GetViewsTypes <WidgetSetting>(); widgets = (from widgetView in widgetsViews let nameWithoutPrefix = widgetView.Name.Substring("Views_Shared_Components_Widget_".Length) where nameWithoutPrefix != "Index" && nameWithoutPrefix != "Widget" && !nameWithoutPrefix.EndsWith("Edit") select nameWithoutPrefix).ToArray(); } }
public WidgetController(FujiyBlogDatabase db, WidgetSettingRepository widgetSettingRepository) { this.db = db; this.widgetSettingRepository = widgetSettingRepository; }