コード例 #1
0
        public Settings(int moduleId, int tabModuleId)
        {
            _moduleId = moduleId;
            _tabModuleId = tabModuleId;

            var mc = new ModuleController();
            ModuleSettings = mc.GetModuleSettings(_moduleId);
            TabModuleSettings = mc.GetTabModuleSettings(_tabModuleId);

            History = TabModuleSettings.GetInteger(SettingName.History, _History);
            DescriptionLength = TabModuleSettings.GetInteger(SettingName.DescriptionLength, _DescriptionLength);
            EditorHeight = TabModuleSettings.GetInteger(SettingName.EditorHeight, _EditorHeight);
            RepeatTemplate = TabModuleSettings.GetInteger(SettingName.RepeatTemplate, _defaultRepeatTemplate);
            DefaultViewType = Utilities.StringToViewType(TabModuleSettings.GetString(SettingName.DefaultViewType, _DefaultViewType));
            TemplateType = TabModuleSettings.GetString(SettingName.TemplateType, _TemplateType);
            TemplateName = TabModuleSettings.GetString(SettingName.TemplateName, _TemplateName);
            TemplateLocation = TabModuleSettings.GetString(SettingName.TemplateLocation, _TemplateLocation);
            
            
            //legacy
            ItemTemplate = TabModuleSettings.GetString(SettingName.ItemTemplate, Null.NullString);
            AltItemTemplate = TabModuleSettings.GetString(SettingName.AltItemTemplate, Null.NullString);
            Separator = TabModuleSettings.GetString(SettingName.HeaderTemplate, Null.NullString);
            HeaderTemplate = TabModuleSettings.GetString(SettingName.HeaderTemplate, Null.NullString);
            FooterTemplate = TabModuleSettings.GetString(SettingName.FooterTemplate, Null.NullString);
            RepeatTemplate = TabModuleSettings.GetInteger(SettingName.FooterTemplate, 0);

            Legacy = ModuleSettings.GetBoolean(SettingName.Legacy, _Legacy) || !Legacy && !string.IsNullOrEmpty(ItemTemplate);
        }