public ModelPropertyConfiguration GetConfigurationSettings(string modelName, string propertyKey, string configKey = "") { ModelConfiguration modelConfig = null; ModelPropertyConfiguration propertyConfig = null; modelConfig = ControlPropertyConfigurationCache.GetModelConfiguration(modelName, configKey); if (modelConfig != null) { string[] propertyNames = propertyKey.Split('.'); if (propertyNames.Length == 1) { if (modelConfig.IndexedPropertyConfiguration.Keys.Contains(propertyKey, StringComparer.InvariantCultureIgnoreCase)) { propertyConfig = modelConfig.IndexedPropertyConfiguration[propertyKey]; } } else { for (int propertyCount = 0; propertyCount < propertyNames.Length; propertyCount++) { string actualPropertyName = propertyNames[propertyCount].Contains("[") ? propertyNames[propertyCount].Substring(0, propertyNames[propertyCount].IndexOf("[")) : propertyNames[propertyCount]; if (modelConfig != null) { if (modelConfig.IndexedPropertyConfiguration.Keys.Contains(actualPropertyName, StringComparer.InvariantCultureIgnoreCase)) { ModelPropertyConfiguration propConfig = modelConfig.IndexedPropertyConfiguration[actualPropertyName]; if (propConfig != null) { if (propConfig.IsComplexType || propConfig.IsEnumerable) { modelConfig = ControlPropertyConfigurationCache.GetModelConfiguration(propConfig.ComplexTypeName, configKey); } else { propertyConfig = propConfig; break; } } } } } } } return(propertyConfig); }
public IDictionary <string, ModelPropertyConfiguration> GetModelConfigurationSettings(string modelName, string configKey) { ModelConfiguration mConfiguration = ControlPropertyConfigurationCache.GetModelConfiguration(modelName, configKey); return(mConfiguration != null ? mConfiguration.IndexedPropertyConfiguration : null); }