private ReflectionComposablePartDefinition CreateEmptyDefinition(Type type, ConstructorInfo constructor, IDictionary <string, object> metadata, ICompositionElement origin) { return((ReflectionComposablePartDefinition)ReflectionModelServices.CreatePartDefinition( (type != null) ? type.AsLazy() : null, false, Enumerable.Empty <ImportDefinition>().AsLazy(), Enumerable.Empty <ExportDefinition>().AsLazy(), metadata.AsLazy(), origin)); }
private static List <ExportDefinition> CreateExports(Type type) { List <ExportDefinition> exports = new List <ExportDefinition>(); foreach (PropertyInfo property in type.GetProperties()) { exports.Add(ReflectionModelServices.CreateExportDefinition(new LazyMemberInfo(property), "Contract", new Lazy <IDictionary <string, object> >(() => null, false), new TypeOrigin(type))); } return(exports); }
public static ContractBasedImportDefinition CreateImportDefinition( Lazy <ParameterInfo> parameter, string contractName, string requiredTypeIdentity, IEnumerable <KeyValuePair <string, Type> > requiredMetadata, ImportCardinality cardinality, CreationPolicy requiredCreationPolicy, bool isExportFactory, ICompositionElement origin) { return(ReflectionModelServices.CreateImportDefinition(parameter, contractName, requiredTypeIdentity, requiredMetadata, cardinality, requiredCreationPolicy, isExportFactory, origin)); }
private ReflectionComposablePartDefinition CreateReflectionPartDefinition( Lazy <Type> partType, bool requiresDisposal, Func <IEnumerable <ImportDefinition> > imports, Func <IEnumerable <ExportDefinition> > exports, IDictionary <string, object> metadata, ICompositionElement origin) { return((ReflectionComposablePartDefinition)ReflectionModelServices.CreatePartDefinition(partType, requiresDisposal, new Lazy <IEnumerable <ImportDefinition> >(imports, false), new Lazy <IEnumerable <ExportDefinition> >(exports, false), metadata.AsLazy(), origin)); }
private static ReflectionMemberExportDefinition CreateReflectionExportDefinition(LazyMemberInfo exportMember, string contractname, IDictionary <string, object> metadata, ICompositionElement origin) { return((ReflectionMemberExportDefinition)ReflectionModelServices.CreateExportDefinition( exportMember, contractname, CreateLazyMetadata(metadata), origin)); }
public static bool IsExportFactoryImportDefinition(ImportDefinition importDefinition) { return(ReflectionModelServices.IsExportFactoryImportDefinition(importDefinition)); }