Freigeben über


VirtualTypeBuilder.InitializeFromType Method (ITypeResolutionService, CodeNamespace)

Initializes this virtual type builder with data obtained from the given type.

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

Syntax

'Declaration
Public Sub InitializeFromType ( _
    typeResolutionService As ITypeResolutionService, _
    ns As CodeNamespace _
)
'Usage
Dim instance As VirtualTypeBuilder
Dim typeResolutionService As ITypeResolutionService
Dim ns As CodeNamespace

instance.InitializeFromType(typeResolutionService, _
    ns)
public void InitializeFromType(
    ITypeResolutionService typeResolutionService,
    CodeNamespace ns
)
public:
void InitializeFromType(
    ITypeResolutionService^ typeResolutionService, 
    CodeNamespace^ ns
)
member InitializeFromType : 
        typeResolutionService:ITypeResolutionService * 
        ns:CodeNamespace -> unit 
public function InitializeFromType(
    typeResolutionService : ITypeResolutionService, 
    ns : CodeNamespace
)

Parameters

Exceptions

Exception Condition
ArgumentNullException

If any of the parameters are nulla null reference (Nothing in Visual Basic).

ArgumentException

If ns contains anything other than a single type declaration.

Remarks

The InitializeFromType method will clear all member collections and repopulate them based on a type declaration.

.NET Framework Security

See Also

Reference

VirtualTypeBuilder Class

VirtualTypeBuilder Members

InitializeFromType Overload

Microsoft.VisualStudio.Shell.Design Namespace