Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

LifetimeContext::GetOrCreate Method (Int32, CompositionOperation^, CompositeActivator^)

.NET Framework (current version)
 

Retrieves a shared part that has the specified ID, or creates it if it wasn't found.

Namespace:   System.Composition.Hosting.Core
Assembly:  System.Composition.Hosting (in System.Composition.Hosting.dll)

public:
Object^ GetOrCreate(
	int sharingId,
	CompositionOperation^ operation,
	CompositeActivator^ creator
)

Parameters

sharingId
Type: System::Int32

The ID of the shared part.

operation
Type: System.Composition.Hosting.Core::CompositionOperation^

An operation in which to create the part, if necessary.

creator
Type: System.Composition.Hosting.Core::CompositeActivator^

An activator that can activate a new part instance, if necessary.

Return Value

Type: System::Object^

The new or retrieved part.

Return to top
Show:
© 2017 Microsoft