コード例 #1
0
 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));
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 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));
 }
コード例 #4
0
 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));
 }
コード例 #5
0
 private static ReflectionMemberExportDefinition CreateReflectionExportDefinition(LazyMemberInfo exportMember, string contractname, IDictionary <string, object> metadata, ICompositionElement origin)
 {
     return((ReflectionMemberExportDefinition)ReflectionModelServices.CreateExportDefinition(
                exportMember, contractname, CreateLazyMetadata(metadata), origin));
 }
コード例 #6
0
 public static bool IsExportFactoryImportDefinition(ImportDefinition importDefinition)
 {
     return(ReflectionModelServices.IsExportFactoryImportDefinition(importDefinition));
 }