IVsDataProvider.GetAssembly (Método) (Guid, String)
解决一提供程序特定程序集字符串为其对应的 Assembly 表示。,特定 DDEX 数据源。
Espacio de nombres: Microsoft.VisualStudio.Data.Core
Ensamblado: Microsoft.VisualStudio.Data.Core (en Microsoft.VisualStudio.Data.Core.dll)
Sintaxis
'Declaración
Function GetAssembly ( _
source As Guid, _
assemblyString As String _
) As Assembly
Assembly GetAssembly(
Guid source,
string assemblyString
)
Assembly^ GetAssembly(
Guid source,
String^ assemblyString
)
abstract GetAssembly :
source:Guid *
assemblyString:string -> Assembly
function GetAssembly(
source : Guid,
assemblyString : String
) : Assembly
Parámetros
source
Tipo: Guid数据源 DDEX 标识符。
assemblyString
Tipo: String一个提供程序程序集特定字符串。
Valor devuelto
Tipo: Assembly
表示程序集从指定的 DDEX 数据源指定的程序集中字符串解析的 Assembly 对象,如果找到,;否则,返回 nullreferencia null (Nothing en Visual Basic)。
Excepciones
Excepción | Condición |
---|---|
ArgumentNullException | assemblyString 参数为 nullreferencia null (Nothing en Visual Basic)。 |
[<ANY>] | DDEX 提供程序 GetAssembly 实现的 GetAssembly 或引发了异常。 |
Comentarios
此方法检查参数值是否源为非空,GUID,如果是,DDEX 调用提供程序的 GetAssembly 方法,因此,如果存在)。 如果程序集此时不可用,它调用 GetAssembly 方法。
Ejemplos
下面的代码演示如何调用带有一提供程序程序集特定字符串的此方法从程序集以后检索字符串资源。
using System;
using System.IO;
using System.Reflection;
using Microsoft.VisualStudio.Data.Core;
using Microsoft.VisualStudio.Data.Services.SupportEntities;
public class DDEX_IVsDataProviderExample3
{
public static Stream GetProviderString(IVsDataProvider provider,
string resourceName, string assemblyString)
{
Assembly assembly = provider.GetAssembly(assemblyString);
return assembly.GetManifestResourceStream(resourceName);
}
}
Seguridad de .NET Framework
- Plena confianza para el llamador inmediato. Un código de confianza parcial no puede utilizar este miembro. Para obtener más información, vea Utilizar bibliotecas de código que no es de plena confianza.