示例#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);
        }
示例#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));
        }
示例#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);
        }
示例#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));
        }
        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;
        }
示例#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;
        }
示例#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;
        }
示例#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;
        }
示例#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;
        }
示例#12
0
 public AttributedExportDefinition(AttributedPartCreationInfo partCreationInfo !!, MemberInfo member !!, ExportAttribute exportAttribute !!, Type?typeIdentityType, string contractName)