Example #1
0
        public void Update()
        {
            var objModules = new ModuleController();

            objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.History, History.ToString(CultureInfo.InvariantCulture));
            objModules.UpdateModuleSetting(_moduleId, SettingName.DescriptionLength, DescriptionLength.ToString(CultureInfo.InvariantCulture));
            objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.EditorHeight, EditorHeight.ToString(CultureInfo.InvariantCulture));
            objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.DefaultViewType, Utilities.ViewTypeToString(DefaultViewType));
            objModules.UpdateModuleSetting(_moduleId, SettingName.Legacy, Legacy.ToString(CultureInfo.InvariantCulture));
            objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.TemplateType, TemplateType);
            objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.TemplateName, TemplateName);
            objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.TemplateLocation, TemplateLocation);

            DataCache.RemoveCache(CacheConstants.SettingsCacheKeyFormat(_moduleId, _tabModuleId));
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="format"></param>
        /// <param name="provider"></param>
        public string ToString(string format, IFormatProvider provider)
        {
            if (string.IsNullOrEmpty(format))
            {
                format = "G";
            }

            if (provider == null)
            {
                provider = CultureInfo.CurrentCulture;
            }

            switch (format)
            {
            case "G":
            case "g":
                return(ToString("E", provider));

            case "C":
                return(Code ?? string.Empty);

            case "N":
                return(DisplayName ?? string.Empty);

            case "I":
                return(ImportOnly.ToString());

            case "L":
                return(Legacy.ToString());

            case "E":
                return(!string.IsNullOrEmpty(Code) && !string.IsNullOrEmpty(DisplayName) ?
                       $"{ToString("C", provider)} - {ToString("N", provider)}" :
                       !string.IsNullOrEmpty(DisplayName) ? ToString("N", provider) :
                       !string.IsNullOrEmpty(Code) ? ToString("C", provider) :
                       string.Empty);

            case "e":
                return(!string.IsNullOrEmpty(Code) && !string.IsNullOrEmpty(DisplayName) ?
                       $"{ToString("N", provider)} - {ToString("C", provider)}" :
                       !string.IsNullOrEmpty(DisplayName) ? ToString("N", provider) :
                       !string.IsNullOrEmpty(Code) ? ToString("C", provider) :
                       string.Empty);

            default:
                throw new FormatException($"Format string '{format}' is not valid.");
            }
        }
Example #3
0
        public void Update()
        {
            var objModules = new ModuleController();

            objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.History, History.ToString(CultureInfo.InvariantCulture));
            objModules.UpdateModuleSetting(_moduleId, SettingName.DescriptionLength, DescriptionLength.ToString(CultureInfo.InvariantCulture));
            objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.EditorHeight, EditorHeight.ToString(CultureInfo.InvariantCulture));
            objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.DefaultViewType, Utilities.ViewTypeToString(DefaultViewType));
            objModules.UpdateModuleSetting(_moduleId, SettingName.Legacy, Legacy.ToString(CultureInfo.InvariantCulture));
            objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.TemplateType, TemplateType);
            objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.TemplateName, TemplateName);
            objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.TemplateLocation, TemplateLocation);


            ModuleController.SynchronizeModule(_moduleId);
            // DataCache.RemoveCache(ModuleController.CacheKey(_moduleId) + "_viewType");
            // Module caching has been updated in 5.2.0, this method is no longer used

            DataCache.RemoveCache(CacheConstants.SettingsCacheKeyFormat(_moduleId, _tabModuleId));
        }