public ThemesController
     (IThemesService themes,
     IArticleService articles)
 {
     this.themes   = themes;
     this.articles = articles;
 }
Пример #2
0
        public static EmbeddedFileProvider GetProvider(IConfiguration config)
        {
            // load the theme from the options.
            string ui = config["Hood:UI"];

            IThemesService themeService = Engine.Services.Resolve <IThemesService>();
            Theme          theme        = themeService.Current;

            if (theme != null)
            {
                ui = theme.UI;
            }

            switch (ui)
            {
            case "Bootstrap3":
                var bs3Assembly = Engine.ResolveUI("Hood.UI.Bootstrap3");
                if (bs3Assembly == null)
                {
                    return(null);
                }
                return(new EmbeddedFileProvider(bs3Assembly, "Hood.UI.Bootstrap3"));

            case "Bootstrap4":
                var bs4Assembly = Engine.ResolveUI("Hood.UI.Bootstrap4");
                if (bs4Assembly == null)
                {
                    return(null);
                }
                return(new EmbeddedFileProvider(bs4Assembly, "Hood.UI.Bootstrap4"));
            }
            return(null);
        }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the FactsController class.
 /// It's being called by the StartUp class.
 /// </summary>
 /// <param name="factsService">A required service for the class.</param>
 /// <param name="tagsService">A required service for the class.</param>
 /// <param name="usersService">A required service for the class.</param>
 public FactsController(IFactsService factsService, ITagsService tagsService, IUsersService usersService, IThemesService themesService)
 {
     this.factsService  = factsService;
     this.tagsService   = tagsService;
     this.usersService  = usersService;
     this.themesService = themesService;
 }
 public HomeworksController(
     IThemesService themesService,
     IHomeworksService homeworksService)
 {
     this.themesService    = themesService;
     this.homeworksService = homeworksService;
 }
Пример #5
0
 public SectionsController
     (ISectionsService sections,
     IThemesService themes,
     UserManager <User> userManager)
 {
     this.sections    = sections;
     this.themes      = themes;
     this.userManager = userManager;
 }
Пример #6
0
 public ExamsController(
     IExamsService examsService,
     IThemesService themesService,
     UserManager <ApplicationUser> userManager)
 {
     this.examsService  = examsService;
     this.themesService = themesService;
     this.userManager   = userManager;
 }
Пример #7
0
        private static void OnPropertyChanged(BindableObject bindable, object oldValue, object newValue)
        {
            IThemesService themesService    = DependencyService.Get <IThemesService>();
            var            resourceTypeName = themesService.CurrentTheme.ResourceTypeName;

            var xfView = ((View)bindable);

            if (!string.IsNullOrEmpty(resourceTypeName))
            {
                xfView.StyleClass = new List <string>()
                {
                    (string)newValue
                };
            }
            else
            {
                xfView.StyleClass = new List <string>();
            }
        }
Пример #8
0
 /// <summary>
 /// Initializes a new instance of the HomeController class.
 /// It's being called by the StartUp class.
 /// </summary>
 /// <param name="themesService">A required service for the class.</param>
 /// <param name="factsService">A required service for the class.</param>
 public HomeController(IThemesService themesService, IFactsService factsService)
 {
     this.themesService = themesService;
     this.factsService  = factsService;
 }
Пример #9
0
 public ThemesController(IThemesService themesService)
 {
     this.themesService = themesService;
 }
Пример #10
0
 /// <summary>
 /// Initializes a new instance of the ThemesController class.
 /// It's being called by the StartUp class.
 /// </summary>
 /// <param name="service">A required service for the class.</param>
 public ThemesController(IThemesService service)
 {
     this.service = service;
 }