IdeaBlade DevForce 2010 Help Reference
Add Method
See Also  Example Send Feedback
IdeaBlade.Core Assembly > IdeaBlade.Core.Composition Namespace > CompositionHost Class : Add Method



catalog
Add dynamic content to the container.

Syntax

Visual Basic (Declaration) 
Public Shared Sub Add( _
   ByVal catalog As ComposablePartCatalog _
) 
Visual Basic (Usage)Copy Code
Dim catalog As ComposablePartCatalog
 
CompositionHost.Add(catalog)
C# 
public static void Add( 
   ComposablePartCatalog catalog
)
C++/CLI 
public:
static void Add( 
   ComposablePartCatalog^ catalog
) 

Parameters

catalog

Example

C#Copy Code
// If using MEF DeploymentCatalog, add to the DevForce CompositionHost after download.
public void AddXap(string uri) {
    DeploymentCatalog catalog;
    catalog = new DeploymentCatalog(uri);
    catalog.DownloadAsync();
    catalog.DownloadCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(catalog_DownloadCompleted);
}

private void catalog_DownloadCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) {
  IdeaBlade.Core.Composition.CompositionHost.Add(sender as DeploymentCatalog);
}

Remarks

This is usually used to add a DeploymentCatalog to the container, although an AggregateCatalog or AssemblyCatalog will be processed also. The catalog is used to recompose the internal "parts" catalog. The CompositionHost.Recomposed event is fired to indicate that dynamic content has been loaded.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.