예제 #1
0
        public static DropdownPropertyDataSourceSettings GetConfig()
        {
            DropdownPropertyDataSourceSettings settings = (DropdownPropertyDataSourceSettings)ConfigurationBroker.GetSection("dropdownPropertyDataSourceSettings");

            if (settings == null)
            {
                settings = new DropdownPropertyDataSourceSettings();
            }

            return(settings);
        }
예제 #2
0
        public object GetDataSource(string dataSourceID)
        {
            List <InlineDataSourceItem> result = new List <InlineDataSourceItem>();

            if (dataSourceID.IsNotEmpty())
            {
                DropdownPropertyDataSourceConfigurationElement configElement = DropdownPropertyDataSourceSettings.GetConfig().PropertySources[dataSourceID];

                if (configElement != null)
                {
                    foreach (InlineDropdownPropertyDataSourceItemConfigurationElement inlineItem in configElement.InlineItems)
                    {
                        InlineDataSourceItem item = new InlineDataSourceItem()
                        {
                            Key = inlineItem.Name, Name = inlineItem.Description
                        };

                        result.Add(item);
                    }
                }
            }

            return(result);
        }
예제 #3
0
        private static Dictionary <string, DropdownPropertyDataSourceConfigurationElement> GetAllDropdownPropertyDataSource()
        {
            Dictionary <string, DropdownPropertyDataSourceConfigurationElement> result = new Dictionary <string, DropdownPropertyDataSourceConfigurationElement>();
            DropdownPropertyDataSourceConfigurationCollection propertiesSource         = DropdownPropertyDataSourceSettings.GetConfig().PropertySources;

            foreach (DropdownPropertyDataSourceConfigurationElement item in propertiesSource)
            {
                result.Add(item.Name, item);
            }

            return(result);
        }