Inheritance: Fleux.UIElements.Panorama.PanoramaSection
Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
        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);
        }