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 _
)
用法
Dim instance As VirtualTypeBuilder
Dim typeResolutionService As ITypeResolutionService
Dim typeDecl As CodeTypeDeclaration
Dim namespaceName As String
instance.InitializeFromType(typeResolutionService, _
    typeDecl, namespaceName)
public void InitializeFromType(
    ITypeResolutionService typeResolutionService,
    CodeTypeDeclaration typeDecl,
    string namespaceName
)
public:
void InitializeFromType(
    ITypeResolutionService^ typeResolutionService, 
    CodeTypeDeclaration^ typeDecl, 
    String^ namespaceName
)
member InitializeFromType : 
        typeResolutionService:ITypeResolutionService * 
        typeDecl:CodeTypeDeclaration * 
        namespaceName:string -> unit 
public function InitializeFromType(
    typeResolutionService : ITypeResolutionService, 
    typeDecl : CodeTypeDeclaration, 
    namespaceName : String
)
Parameters
- typeResolutionService
Type: System.ComponentModel.Design.ITypeResolutionService
The type resolution service to use when resolving types in the Code Document Object Model (CodeDOM) tree. 
- typeDecl
Type: System.CodeDom.CodeTypeDeclaration
Used to initialize a type based on a type declaration. 
- 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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.