Beispiel #1
0
        private void RegisterMutipleComponentComponentRegistration(ComponentRegistryDefinition componentRegistryDefinition, ComponentRegistryDefinition.ComponentRegistrationDefinition componentRegistrationDefinition)
        {
            var interfaceType      = TypeResolver.Resolve(componentRegistrationDefinition.Interface, assemblyHint: componentRegistrationDefinition.Dll);
            var implementationType = TypeResolver.Resolve(componentRegistrationDefinition.Implementation, componentRegistrationDefinition.Dll, componentRegistryDefinition.PluginFolder);

            RegisterComponent(
                interfaceType,
                implementationType,
                componentRegistrationDefinition.ResolveKey ?? implementationType.FullName,
                componentRegistrationDefinition.Activation ?? ActivationType.Instance
                );
        }
Beispiel #2
0
        private void RegisterComponentRegistration(ComponentRegistryDefinition componentRegistryDefinition, ComponentRegistryDefinition.ComponentRegistrationDefinition componentRegistrationDefinition)
        {
            if (string.IsNullOrWhiteSpace(componentRegistrationDefinition.Implementation))
            {
                throw new ArgumentException("No implementation field provided in component registry definition");
            }
            var interfaceType      = TypeResolver.Resolve(componentRegistrationDefinition.Interface, assemblyHint: componentRegistrationDefinition.Dll);
            var implementationType = TypeResolver.Resolve(componentRegistrationDefinition.Implementation, componentRegistrationDefinition.Dll, componentRegistryDefinition.PluginFolder);
            var activation         = componentRegistrationDefinition.Activation;

            RegisterComponent(
                interfaceType,
                implementationType,
                componentRegistrationDefinition.ResolveKey,
                activation ?? ActivationType.Instance
                );
        }