Example #1
0
        /// <summary>
        /// Configures the component with specified parameters.
        /// </summary>
        /// <param name="config">configuration parameters to set.</param>
        /// See <see cref="ConfigParams"/>
        public void Configure(ConfigParams config)
        {
            ConfigParams dependencies = config.GetSection("dependencies");

            foreach (string name in dependencies.Keys)
            {
                string locator = dependencies.Get(name);
                if (locator == null)
                {
                    continue;
                }

                try
                {
                    Descriptor descriptor = Descriptor.FromString(locator);
                    if (descriptor != null)
                    {
                        _dependencies[name] = descriptor;
                    }
                    else
                    {
                        _dependencies[name] = locator;
                    }
                }
                catch (Exception)
                {
                    _dependencies[name] = locator;
                }
            }
        }