Пример #1
0
        public override IEnumerable <Tuple <ComposablePartDefinition, ExportDefinition> > GetExports(ImportDefinition definition)
        {
            var exports = _innerCatalog.GetExports(definition);

            return(exports.Select(e =>
                                  new Tuple <ComposablePartDefinition, ExportDefinition>(GetCustomPart(e.Item1), e.Item2)
                                  ));
        }
Пример #2
0
 public override IEnumerable <Tuple <ComposablePartDefinition, ExportDefinition> > GetExports(ImportDefinition definition)
 {
     lock (locker)
     {
         return(catalogToFilter
                .GetExports(definition)
                .Where(x => IsMatch(x.Item1) && IsMatch(x.Item2))
                .ToList());
     }
 }
Пример #3
0
        public static IEnumerable <Tuple <ComposablePartDefinition, ExportDefinition> > GetExports(this ComposablePartCatalog catalog, Expression <Func <ExportDefinition, bool> > constraint)
        {
            var import = ImportDefinitionFactory.Create(constraint);

            return(catalog.GetExports(import));
        }
Пример #4
0
 public static Tuple <ComposablePartDefinition, ExportDefinition> GetExport <T>(this ComposablePartCatalog catalog)
 {
     return(catalog.GetExports(ImportDefinitionFactory.Create(typeof(T), ImportCardinality.ExactlyOne)).Single());
 }
Пример #5
0
 public static Tuple <ComposablePartDefinition, ExportDefinition>[] GetExports <T>(this ComposablePartCatalog catalog)
 {
     return(catalog.GetExports(ImportDefinitionFactory.Create(typeof(T), ImportCardinality.ZeroOrMore)).ToArray());
 }
Пример #6
0
 public override IEnumerable <Tuple <ComposablePartDefinition, ExportDefinition> > GetExports(ImportDefinition definition)
 {
     return(from export in catalogToFilter.GetExports(definition)
            where IsMatch(export.Item1) && IsMatch(export.Item2)
            select export);
 }