Compartilhar via


IVsOwnedProjectFactory Interface

Used by projects that support being aggregated by an Owner to persist the OwnerKey in their project file.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Declaration
<InterfaceTypeAttribute()> _
<GuidAttribute("E4197123-1086-4D51-B2D5-903F4D61C5AA")> _
Public Interface IVsOwnedProjectFactory
[InterfaceTypeAttribute()]
[GuidAttribute("E4197123-1086-4D51-B2D5-903F4D61C5AA")]
public interface IVsOwnedProjectFactory
[InterfaceTypeAttribute()]
[GuidAttribute(L"E4197123-1086-4D51-B2D5-903F4D61C5AA")]
public interface class IVsOwnedProjectFactory
[<InterfaceTypeAttribute()>]
[<GuidAttribute("E4197123-1086-4D51-B2D5-903F4D61C5AA")>]
type IVsOwnedProjectFactory =  interface end
public interface IVsOwnedProjectFactory

The IVsOwnedProjectFactory type exposes the following members.

Methods

  Name Description
Public method InitializeForOwner Called by the project owner to tell the owned project to do all its initialization.
Public method PreCreateForOwner Gives the owned project a chance to create an aggregated project object based on the input controlling IUnknown (pUnkOwner).

Top

Remarks

Projects that support being aggregated by an Owner must persist the OwnerKey in their project file. When CreateProject is called on a project with an OwnerKey, the owned project should convert its OwnerKey to a project factory GUID then call CreateProject on this project factory to do the actual creation.

An owner will create its owned project in two phases:

  1. Call PreCreateForOwner. This gives the owned project a chance to create an aggregated project object based on the input controlling IUnknown (pUnkOwner). The owned project passes back the inner IUnknown and the aggregated object to the owner project, giving it a chance to store the inner IUnknown.

  2. Call InitializeForOwner. The owned project does all its instantiation here (what usually goes into CreateProject on unowned projects). The input VSOWNEDPROJECTOBJECT is typically the aggregated owned project. The owned project can use this variable to determine if its project object has already been created (cookie !=nulla null reference (Nothing in Visual Basic)) or needs to be created (cookie==nulla null reference (Nothing in Visual Basic)).

Related Property: VSHPROPID_OwnerKey — BSTR owner key string that identifies the project GUID of the owning project. Only projects that implement IVsOwnedProjectFactory should support this property.

Notes to Implementers

Implemented by projects that support being aggregated by an Owner to persist the OwnerKey in their project file.

Notes to Callers

Called by an owner to create its owned project.

See Also

Reference

Microsoft.VisualStudio.Shell.Interop Namespace