Пример #1
0
        private IEnumerable <IMessageTransfer> GetTransfers()
        {
            IEnumerable <IMessageTransfer> r = null;

            using (var catalog = new DirectoryCatalog(Path.Combine(_acDomain.GetPluginBaseDirectory(PluginType.MessageTransfer), "Bin")))
                using (var container = new CompositionContainer(catalog))
                {
                    var infoValueConverterImport = new MessageTransferImport();
                    infoValueConverterImport.ImportsSatisfied += (sender, e) =>
                    {
                        r = e.Transfers;
                    };
                    container.ComposeParts(infoValueConverterImport);
                }
            return(r);
        }
Пример #2
0
 private IEnumerable<IMessageTransfer> GetTransfers()
 {
     IEnumerable<IMessageTransfer> r = null;
     using (var catalog = new DirectoryCatalog(Path.Combine(_acDomain.GetPluginBaseDirectory(PluginType.MessageTransfer), "Bin")))
     using (var container = new CompositionContainer(catalog))
     {
         var infoValueConverterImport = new MessageTransferImport();
         infoValueConverterImport.ImportsSatisfied += (sender, e) =>
         {
             r = e.Transfers;
         };
         container.ComposeParts(infoValueConverterImport);
     }
     return r;
 }