共用方式為


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)
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 文字範本