Ejemplo n.º 1
0
        public ControlTemplateConfiguration GetTemplateConfiguration(string templateKey)
        {
            ControlTemplateConfiguration resultHTML = null;

            resultHTML = ControlPropertyConfigurationCache.GetTemplateConfiguration(templateKey);
            return(resultHTML);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        public static void Configure()
        {
            IEnumerable <PropertyConfiguration> propertyConfigurations = ControlLibraryConfig.ConfigService.Get <PropertyConfiguration>(ControlLibConstants.PROPERTY_CONFIGURATION_TYPE);
            IEnumerable <ModelConfiguration>    modelConfigurations    = ControlLibraryConfig.ConfigService.Get <ModelConfiguration>(ControlLibConstants.MODEL_CONFIGURATION_TYPE);

            foreach (ModelConfiguration item in modelConfigurations)
            {
                if (ControlLibraryConfig.ControlConfigReader.GetModelConfigurationSettings(item.Name, item.ConfigKey) == null)
                {
                    ControlPropertyConfigurationCache.SetModelConfiguration(item.Name, item.ConfigKey, item, propertyConfigurations);
                }
            }

            IEnumerable <ControlDefaultPropertyBag> controlProperties = ControlLibraryConfig.ConfigService.Get <ControlDefaultPropertyBag>(ControlLibConstants.CONTROL_DEFAULT_PROPERTY_TYPE);

            foreach (ControlDefaultPropertyBag item in controlProperties)
            {
                if (ControlLibraryConfig.ControlConfigReader.GetControlDefaultsValues(item.ControlName) == null)
                {
                    ControlPropertyConfigurationCache.SetDefaultPropertyBag(item.ControlName.ToString(), item);
                }
            }

            IEnumerable <ControlTemplateConfiguration> controlTemplateConfigurations = ControlLibraryConfig.ConfigService.Get <ControlTemplateConfiguration>(ControlLibConstants.CONTROL_TEMPALTE_CONFIGURATION_TYPE);

            foreach (ControlTemplateConfiguration item in controlTemplateConfigurations)
            {
                if (ControlLibraryConfig.ControlConfigReader.GetTemplateConfiguration(item.TemplateKey) == null)
                {
                    ControlPropertyConfigurationCache.SetTemplateConfiguration(item.TemplateKey, item);
                }
            }

            IEnumerable <DataGridDefinitions> dataGridColumDefinitions = ControlLibraryConfig.ConfigService.Get <DataGridDefinitions>(ControlLibConstants.DATAGRID_DEFINITION_TYPE);

            foreach (DataGridDefinitions item in dataGridColumDefinitions)
            {
                if (ControlLibraryConfig.ControlConfigReader.GetGridDataColumnDefinition(item.GridName) == null)
                {
                    ControlPropertyConfigurationCache.SetGridDataColumnDefinitions(item.GridName, item);
                }
            }

            IEnumerable <DenomTemplates> denomTemplatess = ControlLibraryConfig.ConfigService.Get <DenomTemplates>(ControlLibConstants.DENOM_TEMPLATE_TYPE);

            foreach (DenomTemplates item in denomTemplatess)
            {
                if (ControlLibraryConfig.ControlConfigReader.GetDenomTemplate(item.TemplateName) == null)
                {
                    ControlPropertyConfigurationCache.SetDenomTemplates(item.TemplateName, item);
                }
            }

            IEnumerable <CustomValidationExpressionConfiguration> customValidationExpressionConfigurations = ControlLibraryConfig.ConfigService.Get <CustomValidationExpressionConfiguration>(ControlLibConstants.CUSTOM_VALIDATION_EXPRESSION_CONFIGURATION_TYPE);

            foreach (CustomValidationExpressionConfiguration item in customValidationExpressionConfigurations)
            {
                if (ControlLibraryConfig.ControlConfigReader.GetCustomValidationExpressionConfiguration(item.ValidationType.ToString()) == null)
                {
                    ControlPropertyConfigurationCache.SetCustomValidationExpressionConfiguration(item.ValidationType.ToString(), item);
                }
            }
        }
Ejemplo n.º 4
0
        public IDictionary <string, ModelPropertyConfiguration> GetModelConfigurationSettings(string modelName, string configKey)
        {
            ModelConfiguration mConfiguration = ControlPropertyConfigurationCache.GetModelConfiguration(modelName, configKey);

            return(mConfiguration != null ? mConfiguration.IndexedPropertyConfiguration : null);
        }
Ejemplo n.º 5
0
 public ControlDefaultPropertyBag GetControlDefaultsValues(ControlNames controlName)
 {
     return(ControlPropertyConfigurationCache.GetDefaultPropertyBag(controlName.ToString()));
 }
Ejemplo n.º 6
0
 public CustomValidationExpressionConfiguration GetCustomValidationExpressionConfiguration(string validationType)
 {
     return(ControlPropertyConfigurationCache.GetCustomValidationExpressionConfiguration(validationType));
 }
Ejemplo n.º 7
0
 public DenomTemplates GetDenomTemplate(string denomTemplateName)
 {
     return(ControlPropertyConfigurationCache.GetDenomTemplates(denomTemplateName));
 }
Ejemplo n.º 8
0
 public DataGridDefinitions GetGridDataColumnDefinition(string gridName)
 {
     return(ControlPropertyConfigurationCache.GetGridDataColumnDefinitions(gridName));
 }