public static void SetModelConfiguration(string name, string configKey, ModelConfiguration modelConfiguration, IEnumerable<PropertyConfiguration> propertyConfigurations)
        {
            ModelConfiguration modelConfig = null;
            if (string.IsNullOrEmpty(configKey))
            {
                modelConfig = _modelConfigurationList.Where(o => o.LookUpKey == name).FirstOrDefault();
            }
            else
            {
                modelConfig = _modelConfigurationList.Where(o => o.LookUpKey == string.Format("{0}.{1}", name, configKey)).FirstOrDefault();
            }

            if (modelConfiguration != null && modelConfig == null)
            {

                foreach (var property in modelConfiguration.PropertyConfiguration)
                {
                    PropertyConfiguration p = propertyConfigurations.Where(o=>o.Key == property.Key).FirstOrDefault();
                    if (p != null)
                        property.PropertyConfiguration = p;
                }

                _modelConfigurationList.Add(modelConfiguration);
            }
        }
Example #2
0
        public IDictionary <string, ModelPropertyConfiguration> GetModelConfigurationSettings(string modelName, string configKey)
        {
            ModelConfiguration mConfiguration = ControlPropertyConfigurationCache.GetModelConfiguration(modelName, configKey);

            return(mConfiguration != null ? mConfiguration.IndexedPropertyConfiguration : null);
        }