DependencyAccessor::TryResolveOptionalDependency Method (Object^, CompositionContract^, Boolean, CompositionDependency^)
.NET Framework (current version)
Resolves an optional dependency based on one implementation of a contract.
Assembly: System.Composition.Hosting (in System.Composition.Hosting.dll)
public: bool TryResolveOptionalDependency( Object^ site, CompositionContract^ contract, bool isPrerequisite, [OutAttribute] CompositionDependency^% dependency )
Parameters
- site
-
Type:
System::Object^
A tag that describes the dependency site.
- contract
-
Type:
System.Composition.Hosting.Core::CompositionContract^
The contract required by the site.
- isPrerequisite
-
Type:
System::Boolean
A value that indicates whether the dependency must be satisfied before exports are made available.
- dependency
-
Type:
System.Composition.Hosting.Core::CompositionDependency^
After this method returns, contains the resolved dependency.
Show: