Поделиться через


ITextTemplatingEngineHost.StandardAssemblyReferences - свойство

Получает список ссылок на сборки.

Пространство имен:  Microsoft.VisualStudio.TextTemplating
Сборка:  Microsoft.VisualStudio.TextTemplating.Interfaces.10.0 (в Microsoft.VisualStudio.TextTemplating.Interfaces.10.0.dll)

Синтаксис

'Декларация
ReadOnly Property StandardAssemblyReferences As IList(Of String)
    Get
IList<string> StandardAssemblyReferences { get; }
property IList<String^>^ StandardAssemblyReferences {
    IList<String^>^ get ();
}
abstract StandardAssemblyReferences : IList<string>
function get StandardAssemblyReferences () : IList<String>

Значение свойства

Тип: System.Collections.Generic.IList<String>
Объект IList, содержащий имена сборок.

Заметки

Позволяет основному приложению задать стандартные сборки, на которые ссылается созданный класс преобразования (например, System.dll). Обработчик использует эти ссылки, когда он компилирует и выполняет созданный класс преобразования.

Примеры

В следующем примере кода показана возможная реализация пользовательского основного приложения. Данный пример кода является частью большего примера. Полный пример см. в разделе Пошаговое руководство. Создание пользовательского хост-класса для текстовых шаблонов.

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

Безопасность платформы .NET Framework

См. также

Ссылки

ITextTemplatingEngineHost Интерфейс

Microsoft.VisualStudio.TextTemplating - пространство имен

Другие ресурсы

Пошаговое руководство. Создание пользовательского хост-класса для текстовых шаблонов

Создание кода и текстовые шаблоны T4