protected virtual void CreateThemeSection() { IEnumerable <object> fileList = null; try{ fileList = Directory.GetFiles(Path.Combine(HOBD.AppPath, "themes"), "*.theme") .OrderBy(s => s) .Select(s => (object)Path.GetFileName(s)); }catch (Exception e) { Logger.error("HomePage", "No themes found", e); } var section = new ListSection(t("Choose Theme"), null, layoutX, layoutY - SectionContentDelta) { Selected = HOBD.config.Theme, Content = fileList, UIContent = (f) => Path.GetFileNameWithoutExtension((string)f), ChooseAction = (path) => { panorama.CurrentSectionIndex -= 1; HOBD.config.Theme = "themes/" + path; HOBD.config.Save(); HOBD.ReloadTheme(); ReloadUI(); } }; this.PushVolatileSection(section); }
protected virtual void CreateLanguageSection() { IEnumerable <object> codesList = Directory.GetFiles(Path.Combine(HOBD.AppPath, "lang"), "??.lang") .Select((f) => (object)Path.GetFileNameWithoutExtension(f)) .OrderBy(s => s); var section = new ListSection(t("Language"), null, layoutX, layoutY - SectionContentDelta) { Selected = HOBD.config.Language, Content = codesList, UIContent = (l) => t((string)l), ChooseAction = (l) => { panorama.CurrentSectionIndex -= 1; HOBD.config.Language = (string)l; HOBD.config.Save(); HOBD.ReloadLang(); ReloadUI(); } }; this.PushVolatileSection(section); }
protected virtual void CreateThemeSection() { IEnumerable<object> fileList = null; try{ fileList = Directory.GetFiles(Path.Combine(HOBD.AppPath, "themes"), "*.theme") .OrderBy(s => s) .Select(s => (object)Path.GetFileName(s)); }catch(Exception e){ Logger.error("HomePage", "No themes found", e); } var section = new ListSection(t("Choose Theme"), null, layoutX, layoutY-SectionContentDelta) { Selected = HOBD.config.Theme, Content = fileList, UIContent = (f) => Path.GetFileNameWithoutExtension((string)f), ChooseAction = (path) => { panorama.CurrentSectionIndex -= 1; HOBD.config.Theme = "themes/"+path; HOBD.config.Save(); HOBD.ReloadTheme(); ReloadUI(); } }; this.PushVolatileSection(section); }
protected virtual void CreateLanguageSection() { IEnumerable<object> codesList = Directory.GetFiles(Path.Combine(HOBD.AppPath, "lang"), "??.lang") .Select( (f) => (object)Path.GetFileNameWithoutExtension(f) ) .OrderBy(s => s); var section = new ListSection(t("Language"), null, layoutX, layoutY-SectionContentDelta) { Selected = HOBD.config.Language, Content = codesList, UIContent = (l) => t((string)l), ChooseAction = (l) => { panorama.CurrentSectionIndex -= 1; HOBD.config.Language = (string)l; HOBD.config.Save(); HOBD.ReloadLang(); ReloadUI(); } }; this.PushVolatileSection(section); }