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: