共用方式為


VirtualTypeBuilder.InitializeFromType Method (ITypeResolutionService, CodeTypeDeclaration, String)

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

'宣告
Public Sub InitializeFromType ( _
    typeResolutionService As ITypeResolutionService, _
    typeDecl As CodeTypeDeclaration, _
    namespaceName As String _
)
public void InitializeFromType(
    ITypeResolutionService typeResolutionService,
    CodeTypeDeclaration typeDecl,
    string namespaceName
)

Parameters

  • namespaceName
    Type: System.String
    The namespace that contains a type to create. This namespace must contain exactly one type.

Exceptions

Exception Condition
ArgumentNullException

If any of the parameters are null.

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

InitializeFromType Overload

Microsoft.VisualStudio.Shell.Design Namespace