public static ComposablePart CreatePart(object attributedPart, ReflectionContext reflectionContext)
        {
            Requires.NotNull(attributedPart, nameof(attributedPart));
            Requires.NotNull(reflectionContext, nameof(reflectionContext));

            return(AttributedModelDiscovery.CreatePart(attributedPart, reflectionContext));
        }
Esempio n. 2
0
        public static ComposablePart CreatePart(object attributedPart)
        {
            Requires.NotNull(attributedPart, nameof(attributedPart));
            Contract.Ensures(Contract.Result <ComposablePart>() != null);

            return(AttributedModelDiscovery.CreatePart(attributedPart));
        }
Esempio n. 3
0
        public static ComposablePart CreatePart(object attributedPart, ReflectionContext reflectionContext)
        {
            Requires.NotNull(attributedPart, "attributedPart");
            Requires.NotNull(reflectionContext, "reflectionContext");
            Contract.Ensures(Contract.Result <ComposablePart>() != null);

            return(AttributedModelDiscovery.CreatePart(attributedPart, reflectionContext));
        }
        public static ComposablePart CreatePart(ComposablePartDefinition partDefinition, object attributedPart)
        {
            Requires.NotNull(partDefinition, nameof(partDefinition));
            Requires.NotNull(attributedPart, nameof(attributedPart));

            var reflectionComposablePartDefinition = partDefinition as ReflectionComposablePartDefinition;

            if (reflectionComposablePartDefinition == null)
            {
                throw ExceptionBuilder.CreateReflectionModelInvalidPartDefinition(nameof(partDefinition), partDefinition.GetType());
            }

            return(AttributedModelDiscovery.CreatePart(reflectionComposablePartDefinition, attributedPart));
        }
Esempio n. 5
0
        public static ComposablePart CreatePart(ComposablePartDefinition partDefinition, object attributedPart)
        {
            Requires.NotNull(partDefinition, "partDefinition");
            Requires.NotNull(attributedPart, "attributedPart");
            Contract.Ensures(Contract.Result <ComposablePart>() != null);

            var reflectionComposablePartDefinition = partDefinition as ReflectionComposablePartDefinition;

            if (reflectionComposablePartDefinition == null)
            {
                throw ExceptionBuilder.CreateReflectionModelInvalidPartDefinition("partDefinition", partDefinition.GetType());
            }

            return(AttributedModelDiscovery.CreatePart(reflectionComposablePartDefinition, attributedPart));
        }
        public static ComposablePart CreatePart(object attributedPart)
        {
            Requires.NotNull(attributedPart, nameof(attributedPart));

            return(AttributedModelDiscovery.CreatePart(attributedPart));
        }