Exemplo n.º 1
0
        public static ReflectionComposablePartDefinition CreatePartDefinition(Type type, PartCreationPolicyAttribute partCreationPolicy, bool ignoreConstructorImports, ICompositionElement origin)
        {
            Assumes.NotNull(type);

            AttributedPartCreationInfo creationInfo = new AttributedPartCreationInfo(type, partCreationPolicy, ignoreConstructorImports, origin);

            return new ReflectionComposablePartDefinition(creationInfo);
        }
Exemplo n.º 2
0
        public static ReflectionComposablePartDefinition CreatePartDefinition(Type type, PartCreationPolicyAttribute partCreationPolicy, bool ignoreConstructorImports, ICompositionElement origin)
        {
            Assumes.NotNull(type);

            AttributedPartCreationInfo creationInfo = new AttributedPartCreationInfo(type, partCreationPolicy, ignoreConstructorImports, origin);

            return(new ReflectionComposablePartDefinition(creationInfo));
        }
Exemplo n.º 3
0
        public static ComposablePartDefinition CreatePartDefinitionIfDiscoverable(Type type, ICompositionElement origin)
        {
            AttributedPartCreationInfo creationInfo = new AttributedPartCreationInfo(type, null, false, origin);
            if (!creationInfo.IsPartDiscoverable())
            {
                return null;
            }

            return new ReflectionComposablePartDefinition(creationInfo);
        }
Exemplo n.º 4
0
        public static ComposablePartDefinition CreatePartDefinitionIfDiscoverable(Type type, ICompositionElement origin)
        {
            AttributedPartCreationInfo creationInfo = new AttributedPartCreationInfo(type, null, false, origin);

            if (!creationInfo.IsPartDiscoverable())
            {
                return(null);
            }

            return(new ReflectionComposablePartDefinition(creationInfo));
        }
        public static ReflectionComposablePartDefinition CreatePartDefinition(Type type, PartCreationPolicyAttribute partCreationPolicy, bool ignoreConstructorImports, ICompositionElement origin)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            AttributedPartCreationInfo creationInfo = new AttributedPartCreationInfo(type, partCreationPolicy, ignoreConstructorImports, origin);

            return(new ReflectionComposablePartDefinition(creationInfo));
        }
Exemplo n.º 6
0
        public AttributedExportDefinition(AttributedPartCreationInfo partCreationInfo, MemberInfo member, ExportAttribute exportAttribute)
            : base(member.GetContractNameFromExport(exportAttribute), (IDictionary<string, object>)null)
        {
            Assumes.NotNull(partCreationInfo);
            Assumes.NotNull(member);
            Assumes.NotNull(exportAttribute);

            this._partCreationInfo = partCreationInfo;
            this._member = member;
            this._exportAttribute = exportAttribute;
        }
Exemplo n.º 7
0
        public AttributedExportDefinition(AttributedPartCreationInfo partCreationInfo, MemberInfo member, ExportAttribute exportAttribute)
            : base(member.GetContractNameFromExport(exportAttribute), (IDictionary <string, object>)null)
        {
            Assumes.NotNull(partCreationInfo);
            Assumes.NotNull(member);
            Assumes.NotNull(exportAttribute);

            this._partCreationInfo = partCreationInfo;
            this._member           = member;
            this._exportAttribute  = exportAttribute;
        }
Exemplo n.º 8
0
        public AttributedExportDefinition(AttributedPartCreationInfo partCreationInfo, MemberInfo member, ExportAttribute exportAttribute, Type?typeIdentityType, string contractName)
            : base(contractName, (IDictionary <string, object?>?)null)
        {
            ArgumentNullException.ThrowIfNull(partCreationInfo);
            ArgumentNullException.ThrowIfNull(member);
            ArgumentNullException.ThrowIfNull(exportAttribute);

            _partCreationInfo = partCreationInfo;
            _member           = member;
            _exportAttribute  = exportAttribute;
            _typeIdentityType = typeIdentityType;
        }
        public AttributedExportDefinition(AttributedPartCreationInfo partCreationInfo, MemberInfo member, ExportAttribute exportAttribute, Type typeIdentityType, string contractName)
            : base(contractName, (IDictionary <string, object>)null)
        {
            Assumes.NotNull(partCreationInfo);
            Assumes.NotNull(member);
            Assumes.NotNull(exportAttribute);

            this._partCreationInfo = partCreationInfo;
            this._member           = member;
            this._exportAttribute  = exportAttribute;
            this._typeIdentityType = typeIdentityType;
        }
Exemplo n.º 10
0
        public AttributedExportDefinition(AttributedPartCreationInfo partCreationInfo, MemberInfo member, ExportAttribute exportAttribute, Type typeIdentityType, string contractName)
            : base(contractName, (IDictionary<string, object>)null)
        {
            Assumes.NotNull(partCreationInfo);
            Assumes.NotNull(member);
            Assumes.NotNull(exportAttribute);

            this._partCreationInfo = partCreationInfo;
            this._member = member;
            this._exportAttribute = exportAttribute;
            this._typeIdentityType = typeIdentityType;
        }
Exemplo n.º 11
0
        public AttributedExportDefinition(AttributedPartCreationInfo partCreationInfo, MemberInfo member, ExportAttribute exportAttribute, Type?typeIdentityType, string contractName)
            : base(contractName, (IDictionary <string, object?>?)null)
        {
            if (partCreationInfo == null)
            {
                throw new ArgumentNullException(nameof(partCreationInfo));
            }

            if (member == null)
            {
                throw new ArgumentNullException(nameof(member));
            }

            if (exportAttribute == null)
            {
                throw new ArgumentNullException(nameof(exportAttribute));
            }

            _partCreationInfo = partCreationInfo;
            _member           = member;
            _exportAttribute  = exportAttribute;
            _typeIdentityType = typeIdentityType;
        }
Exemplo n.º 12
0
 public AttributedExportDefinition(AttributedPartCreationInfo partCreationInfo !!, MemberInfo member !!, ExportAttribute exportAttribute !!, Type?typeIdentityType, string contractName)