Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CatalogFactory.NonFilteringTypeCatalog.cs « Factories « Composition « ComponentModel « System « ComponentModelUnitTest « Tests « System.ComponentModel.Composition « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 784c54d695aa233304d12b6accab4700d9aeee94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// -----------------------------------------------------------------------
// Copyright (c) Microsoft Corporation.  All rights reserved.
// -----------------------------------------------------------------------
using System;
using System.ComponentModel.Composition.Primitives;
using System.Linq;
using System.Collections.Generic;

namespace System.ComponentModel.Composition.Factories
{
    partial class CatalogFactory
    {
        private class NonFilteringTypeCatalog : ComposablePartCatalog
        {
            private readonly List<ComposablePartDefinition> _definitions;

            public NonFilteringTypeCatalog(params Type[] types)
            {
                this._definitions = new List<ComposablePartDefinition>();
                foreach (Type type in types)
                {
                    this._definitions.Add(AttributedModelServices.CreatePartDefinition(type, null));
                }
            }

            public override IQueryable<ComposablePartDefinition> Parts
            {
                get { return this._definitions.AsQueryable(); }
            }
        }
    }
}