Share via


ITextTemplatingEngineHost.StandardAssemblyReferences (Propiedad)

Obtiene una lista de referencias de ensamblado.

Espacio de nombres:  Microsoft.VisualStudio.TextTemplating
Ensamblado:  Microsoft.VisualStudio.TextTemplating.Interfaces.10.0 (en Microsoft.VisualStudio.TextTemplating.Interfaces.10.0.dll)

Sintaxis

'Declaración
ReadOnly Property StandardAssemblyReferences As IList(Of String)
IList<string> StandardAssemblyReferences { get; }
property IList<String^>^ StandardAssemblyReferences {
    IList<String^>^ get ();
}
abstract StandardAssemblyReferences : IList<string>
function get StandardAssemblyReferences () : IList<String>

Valor de propiedad

Tipo: System.Collections.Generic.IList<String>
Un objeto IList que contiene nombres de ensamblado.

Comentarios

Permite a un host especificar los ensamblados estándar a los que va a hacer referencia la clase de transformación generada (por ejemplo, System.dll).El motor utiliza estas referencias cuando compila y ejecuta la clase de transformación generada.

Ejemplos

El ejemplo de código siguiente muestra una posible implementación para un host personalizado.Este ejemplo de código forma parte de un ejemplo más extenso.Para obtener el ejemplo completo, vea Tutorial: Crear un host de plantillas de texto personalizadas.

public IList<string> StandardAssemblyReferences
{
    get
    {
        return new string[]
        {
            //if this host searches standard paths and the GAC
            //we can specify the assembly name like this
            //---------------------------------------------------------
            //"System"

            //because this host only resolves assemblies from the 
            //fully qualified path and name of the assembly
            //this is a quick way to get the code to give us the
            //fully qualified path and name of the System assembly
            //---------------------------------------------------------
            typeof(System.Uri).Assembly.Location
        };
    }
}
Public ReadOnly Property StandardAssemblyReferences() As IList(Of String) Implements Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost.StandardAssemblyReferences
    Get
        'if this host searches standard paths and the GAC
        'we can specify the assembly name like this
        '---------------------------------------------------------
        'Return New String() {"System"}

        'because this host only resolves assemblies from the 
        'fully qualified path and name of the assembly
        'this is a quick way to get the code to give us the
        'fully qualified path and name of the System assembly
        '---------------------------------------------------------
        Return New String() {(New System.UriBuilder()).GetType().Assembly.Location}
    End Get
End Property

Seguridad de .NET Framework

Vea también

Referencia

ITextTemplatingEngineHost Interfaz

Microsoft.VisualStudio.TextTemplating (Espacio de nombres)

Otros recursos

Tutorial: Crear un host de plantillas de texto personalizadas

Generación de código y plantillas de texto T4