コード例 #1
0
        static void Main(string[] args)
        {
            CompositionContainer container = new CompositionContainer(new AssemblyCatalog(Assembly.GetAssembly(typeof(Program))));

            Program.FileName = Assembly.GetAssembly(typeof(Program)).Location;
            IFileBaseContainer fileBaseContainer = new ManagedAssemblyContainer();

            container.ComposeParts(fileBaseContainer);
            ;
            fileBaseContainer.Initialize();
            ;
            IEnumContents enumContents = fileBaseContainer.Contents;

            ;

            container         = new CompositionContainer(new AssemblyCatalog(Assembly.GetAssembly(typeof(Program))));
            Program.FileName  = @"Package001.dll";
            fileBaseContainer = new UnmanagedCodeContainer();
            container.ComposeParts(fileBaseContainer);
            ;
            fileBaseContainer.Initialize();
            ;
            enumContents = fileBaseContainer.Contents;
            ;
            uint celt = 10U;

            object[] rgelt = new object[celt];
            enumContents.Next(celt, rgelt, out uint pceltFetched);
            ;
        }
コード例 #2
0
 public void Clone(out IEnumContents ppenum)
 {
     ppenum = new CoEnumContent(this.contents);
 }