コード例 #1
0
        protected override FunctionFactoryData GetConfiguration(string name, IConfigurationSource configurationSource)
        {
            FunctionFactorySettings settings = configurationSource.GetSection(FunctionFactorySettings.SectionName) as FunctionFactorySettings;

            if (null == settings)
            {
                throw new ConfigurationErrorsException(string.Format("The configuration section '{0}' was not found in the configuration", FunctionFactorySettings.SectionName));
            }

            int index = name.IndexOf("->");

            string namespaceName = name.Substring(0, index);
            string tag           = name.Substring(index + 2);


            NamespaceConfigurationElement namespaceElement = settings.Namespaces[namespaceName];

            if (null == namespaceElement)
            {
                throw new ConfigurationErrorsException(string.Format("The namespace {0} is missing from the configuration", namespaceName));
            }

            return(namespaceElement.Factories.Get(tag));
        }
コード例 #2
0
 public void Add(NamespaceConfigurationElement element)
 {
     BaseAdd(element);
 }
コード例 #3
0
 public void Add(NamespaceConfigurationElement element)
 {
     BaseAdd(element);
 }