<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : IEventAggregator</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : Community Forum : IEventAggregator</description>
  <pubDate>Sat, 11 Apr 2026 04:24:10 -700</pubDate>
  <lastBuildDate>Fri, 11 May 2012 17:07:11 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=3437</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>IEventAggregator : Yeah, you shouldn&amp;#039;t have...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3437&amp;PID=13575#13575</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3437<br /><strong>Posted:</strong> 11-May-2012 at 5:07pm<br /><br />Yeah, you shouldn't have any issues with this even in Silverlight unless you dynamically load XAPs at runtime, then obviously the exports won't be available until the XAP file got loaded. Exports can be spread over multiple dlls, as long as they are discovered. The default container created by Cocktail gets initialized with the PartsCatalog from DevForce, which contains all your exports unless you mess with the DevForce discovery. DevForce does exclude some assemblies based on their names. For example every assembly starting with IdeaBlade. There are a bunch of others, like third-party vendor assemblies etc. You can get an issue if you accidentally name an assembly such that it happens to match one of the exclusion rules.<DIV>&nbsp;</DIV><DIV><a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/discovery" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/discovery</A></DIV><DIV>&nbsp;</DIV><DIV>In summary, you shouldn't need this func exports. The container should have all exports in it when the bootstrapper is done.</DIV>]]>
   </description>
   <pubDate>Fri, 11 May 2012 17:07:11 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3437&amp;PID=13575#13575</guid>
  </item> 
  <item>
   <title>IEventAggregator : This is a WPF app initially we...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3437&amp;PID=13574#13574</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1375" rel="nofollow">murray.bryant</a><br /><strong>Subject:</strong> 3437<br /><strong>Posted:</strong> 11-May-2012 at 4:16pm<br /><br />This is a WPF app initially we started in silverlight which might be why we had it set like that. But yes the exports are in different dll's<div><br></div><div>Your suggestion worked though.</div><div><br></div><div>My bootstrapper is now much cleaner:</div><div><br></div><div><div>&nbsp;protected override void PrepareCompositionContainer(CompositionBatch batch)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; base.PrepareCompositionContainer(batch);</div><div><br></div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;IAuthenticationService&gt;(new AuthenticationService());</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;Func&lt;IMessageBox&gt;&gt;(() =&gt; Composition.GetInstance&lt;IMessageBox&gt;());</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;Func&lt;ILocationViewModel&gt;&gt;(() =&gt; Composition.GetInstance&lt;ILocationViewModel&gt;());</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;Func&lt;IAssayBatchViewModel&gt;&gt;(() =&gt; Composition.GetInstance&lt;IAssayBatchViewModel&gt;());</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;Func&lt;IImportToDataViewViewModel&gt;&gt;(() =&gt; Composition.GetInstance&lt;IImportToDataViewViewModel&gt;());</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;Func&lt;IImportToObjectsViewModel&gt;&gt;(() =&gt; Composition.GetInstance&lt;IImportToObjectsViewModel&gt;());</div><div>&nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div></div>]]>
   </description>
   <pubDate>Fri, 11 May 2012 16:16:53 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3437&amp;PID=13574#13574</guid>
  </item> 
  <item>
   <title>IEventAggregator : Hit post a little fast. I&amp;#039;m...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3437&amp;PID=13573#13573</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3437<br /><strong>Posted:</strong> 11-May-2012 at 4:12pm<br /><br />Hit post a little fast. I'm not quite understanding your issue. Is the ILocationViewModel in a different XAP that gets dynamically loaded?]]>
   </description>
   <pubDate>Fri, 11 May 2012 16:12:47 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3437&amp;PID=13573#13573</guid>
  </item> 
  <item>
   <title>IEventAggregator : batch.AddExportedValue&amp;lt;Func...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3437&amp;PID=13572#13572</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3437<br /><strong>Posted:</strong> 11-May-2012 at 4:08pm<br /><br />batch.AddExportedValue&lt;Func&lt;ILocationViewModel&gt;&gt;(() =&gt; Composition.GetInstance&lt;ILocationViewModel&gt;());]]>
   </description>
   <pubDate>Fri, 11 May 2012 16:08:57 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3437&amp;PID=13572#13572</guid>
  </item> 
  <item>
   <title>IEventAggregator : Hi MarcelI am doing this because...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3437&amp;PID=13571#13571</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1375" rel="nofollow">murray.bryant</a><br /><strong>Subject:</strong> 3437<br /><strong>Posted:</strong> 11-May-2012 at 3:57pm<br /><br />Hi Marcel<div><br></div><div>I am doing this because I need to add &nbsp;batch.AddExportedValue&lt;Func&lt;ILocationViewModel&gt;&gt; functions and the export of ILocationViewModel is not available &nbsp;at this point in the container because my solution is split across multiple projects.</div><div><br></div><div>It took ages to get this to work, through ignorance, &nbsp;black magic and luck. One of the reasons I went through the pain of switching to Cocktail is that you are making an effort to document it. Which is great!</div><div><br></div><div>Do you know a better way to add the Func &lt;T&gt; into the container? &nbsp;I did look at the documentation but I can't see anything about this.</div><div><br></div><div>Thanks</div><div><br></div><div>Murray</div><div><br></div>]]>
   </description>
   <pubDate>Fri, 11 May 2012 15:57:44 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3437&amp;PID=13571#13571</guid>
  </item> 
  <item>
   <title>IEventAggregator : That still doesn&amp;#039;t look right...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3437&amp;PID=13570#13570</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3437<br /><strong>Posted:</strong> 11-May-2012 at 1:16pm<br /><br />That still doesn't look right at all. Why are you creating your own container? Cocktail creates the container for you. Please see the bootstrapper chapter in the documentation:<DIV>&nbsp;</DIV><DIV><a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/cocktail-applicati&#111;n-bootstrapper" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/cocktail-application-bootstrapper</A></DIV>]]>
   </description>
   <pubDate>Fri, 11 May 2012 13:16:48 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3437&amp;PID=13570#13570</guid>
  </item> 
  <item>
   <title>IEventAggregator : I got it to work.My bootstrapper...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3437&amp;PID=13569#13569</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1375" rel="nofollow">murray.bryant</a><br /><strong>Subject:</strong> 3437<br /><strong>Posted:</strong> 11-May-2012 at 6:27am<br /><br />I got it to work.<div><br></div><div>My bootstrapper is now just this:</div><div><br></div><div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; private CompositionContainer _container;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; public WpfBootstrapper()</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Uncomment to enable Caliburn Micro logging</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // LogManager.GetLog = (Type t) =&gt; Torpedo.Geo.Shared.Helper.CaliburnDebugLog.GetInstanceForType(t);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div><br></div><div>&nbsp; &nbsp; &nbsp;&nbsp;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; protected override void PrepareCompositionContainer(CompositionBatch batch)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; base.PrepareCompositionContainer(batch);</div><div><br></div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp;batch.AddExportedValue&lt;IWindowManager&gt;(new Torpedo.Geo.WPF.TorpedoWindowManager());</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _container = new CompositionContainer(new AggregateCatalog(</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AssemblySource.Instance.Select(x =&gt; new AssemblyCatalog(x)).OfType&lt;ComposablePartCatalog&gt;()</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ));</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp;batch.AddExportedValue&lt;IEntityManagerProvider&lt;TorpedoEntities&gt;&gt;(new EntityManagerProvider&lt;TorpedoEntities&gt;());</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;IAuthenticationService&gt;(new AuthenticationService());</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;Func&lt;IMessageBox&gt;&gt;(() =&gt; _container.GetExportedValue&lt;IMessageBox&gt;());</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;Func&lt;ILocationViewModel&gt;&gt;(() =&gt; _container.GetExportedValue&lt;ILocationViewModel&gt;());</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;Func&lt;IAssayBatchViewModel&gt;&gt;(() =&gt; _container.GetExportedValue&lt;IAssayBatchViewModel&gt;());</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;Func&lt;IImportToDataViewViewModel&gt;&gt;(() =&gt; _container.GetExportedValue&lt;IImportToDataViewViewModel&gt;());</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;Func&lt;IImportToObjectsViewModel&gt;&gt;(() =&gt; _container.GetExportedValue&lt;IImportToObjectsViewModel&gt;());</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _container.Compose(batch);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div></div><div><br></div><div><br></div><div>The rest is not needed anymore</div><div><br></div><div><br></div><div><br></div>]]>
   </description>
   <pubDate>Fri, 11 May 2012 06:27:03 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3437&amp;PID=13569#13569</guid>
  </item> 
  <item>
   <title>IEventAggregator :  HiI am trying to move to Cocktail...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3437&amp;PID=13567#13567</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1375" rel="nofollow">murray.bryant</a><br /><strong>Subject:</strong> 3437<br /><strong>Posted:</strong> 11-May-2012 at 4:13am<br /><br />Hi&nbsp;<div><br></div><div>I am trying to move to Cocktail from DAF. I have almost everything working apart from not being able to import IEventAgregator.</div><div><br></div><div>1) No valid exports were found that match the constraint '((exportDefinition.ContractName == "Caliburn.Micro.IEventAggregator")&nbsp;</div><div><br></div><div>I am at a loss as to why it is not being exported.</div><div><br></div><div>I have included my Bootstrapper code. Hopefully someone can see what I am doing wrong and needs to be changed. It all worked in the old DAF.</div><div><br></div><div>Thanks</div><div><br><div>&nbsp;public class WpfBootstrapper : FrameworkBootstrapper&lt;IShell&gt;</div><div>&nbsp; &nbsp; {</div><div><br></div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; private CompositionContainer _container;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; public WpfBootstrapper()</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Uncomment to enable Caliburn Micro logging</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // LogManager.GetLog = (Type t) =&gt; Torpedo.Geo.Shared.Helper.CaliburnDebugLog.GetInstanceForType(t);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div><br></div><div>&nbsp; &nbsp; &nbsp;&nbsp;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; protected override void PrepareCompositionContainer(CompositionBatch batch)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; base.PrepareCompositionContainer(batch);</div><div><br></div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // batch.AddExportedValue&lt;IWindowManager&gt;(new WindowManager());</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _container = new CompositionContainer(new AggregateCatalog(</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AssemblySource.Instance.Select(x =&gt; new AssemblyCatalog(x)).OfType&lt;ComposablePartCatalog&gt;()</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ));</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;IEntityManagerProvider&lt;TorpedoEntities&gt;&gt;(new EntityManagerProvider&lt;TorpedoEntities&gt;());</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;IAuthenticationService&gt;(new AuthenticationService());</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;Func&lt;IMessageBox&gt;&gt;(() =&gt; _container.GetExportedValue&lt;IMessageBox&gt;());</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;Func&lt;ILocationViewModel&gt;&gt;(() =&gt; _container.GetExportedValue&lt;ILocationViewModel&gt;());</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;Func&lt;IAssayBatchViewModel&gt;&gt;(() =&gt; _container.GetExportedValue&lt;IAssayBatchViewModel&gt;());</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;Func&lt;IImportToDataViewViewModel&gt;&gt;(() =&gt; _container.GetExportedValue&lt;IImportToDataViewViewModel&gt;());</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; batch.AddExportedValue&lt;Func&lt;IImportToObjectsViewModel&gt;&gt;(() =&gt; _container.GetExportedValue&lt;IImportToObjectsViewModel&gt;());</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _container.Compose(batch);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; protected override IEnumerable&lt;Assembly&gt; SelectAssemblies()</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return new&#091;&#093; {&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Assembly.GetExecutingAssembly(),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//Assembly.LoadFrom("Torpedo.Geo.WPF.Mapping.dll"),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Assembly.LoadFrom("Torpedo.Geo.WPF.Viewer.dll"),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Assembly.LoadFrom("Torpedo.Geo.WPF.LocationDetail.dll"),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Assembly.LoadFrom("Torpedo.Geo.WPF.Assay.dll"),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Assembly.LoadFrom("Torpedo.Geo.WPF.Admin.dll"),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Assembly.LoadFrom("Torpedo.Geo.WPF.Import.dll"),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Assembly.LoadFrom("Torpedo.Geo.Shared.dll")</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; protected override object GetInstance(Type serviceType, string key)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string contract = string.IsNullOrEmpty(key) ? AttributedModelServices.GetContractName(serviceType) : key;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var exports = _container.GetExportedValues&lt;object&gt;(contract);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (exports.Count() &gt; 0)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return exports.First();</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; throw new Exception(string.Format("Could not locate any instances of contract {0}.", contract));</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; protected override IEnumerable&lt;object&gt; GetAllInstances(Type serviceType)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return _container.GetExportedValues&lt;object&gt;(AttributedModelServices.GetContractName(serviceType));</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; protected override void BuildUp(object instance)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; base.BuildUp(instance);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _container.SatisfyImportsOnce(instance);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div></div><span style="font-size:10px"><br /><br />Edited by murray.bryant - 11-May-2012 at 4:19am</span>]]>
   </description>
   <pubDate>Fri, 11 May 2012 04:13:59 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3437&amp;PID=13567#13567</guid>
  </item> 
 </channel>
</rss>