Exemple #1
0
        // attempt to load all assemblies passed through configuration
        private void LoadRequestedAssemblies()
        {
            // this is when the validity of the configuration will be important
            // if paths or namespaces are incorrect we won't be able to load
            // the requested resources, resulting in an error state
            ComponentType = GetTypeFromAssembly(ComponentConfiguration.AssemblyPath, ComponentConfiguration.FullyQualifiedClassName);

            // component is required, while message publisher is optional
            // since not all components will use a message publisher
            if (ComponentType is null)
            {
                HostState = HostState.Errored;
            }
            else if (!(MessagePublisherConfiguration is null))
            {
                ConfigureMessagePublisher();
            }

            _componentSettings        = ComponentConfiguration.ToComponentSettings();
            _messagePublisherSettings = MessagePublisherConfiguration.ToMessagePublisherSettings();
        }