IVsDataProvider.GetAssembly Method (Guid, String)

Resolves a provider-specific assembly string to its corresponding Assembly representation, for a specific DDEX data source.

Namespace:  Microsoft.VisualStudio.Data.Core
Assembly:  Microsoft.VisualStudio.Data.Core (in Microsoft.VisualStudio.Data.Core.dll)

Syntax

'宣言
Function GetAssembly ( _
    source As Guid, _
    assemblyString As String _
) As Assembly
'使用
Dim instance As IVsDataProvider
Dim source As Guid
Dim assemblyString As String
Dim returnValue As Assembly

returnValue = instance.GetAssembly(source, _
    assemblyString)
Assembly GetAssembly(
    Guid source,
    string assemblyString
)
Assembly^ GetAssembly(
    Guid source, 
    String^ assemblyString
)
function GetAssembly(
    source : Guid, 
    assemblyString : String
) : Assembly

Parameters

  • source
    Type: System.Guid

    A DDEX data source identifier.

  • assemblyString
    Type: System.String

    A provider-specific assembly string.

Return Value

Type: System.Reflection.Assembly

An Assembly object that represents the assembly that is resolved from the specified assembly string for the specified DDEX data source, if found; otherwise, a null reference (Nothing in Visual Basic).

Exceptions

Exception Condition
ArgumentNullException

The assemblyString parameter is a null reference (Nothing in Visual Basic).

[<ANY>]

The DDEX provider’s GetAssembly or GetAssembly implementation threw an exception.

Remarks

This method checks whether the source parameter value is a non-empty GUID, and, if it is, calls the DDEX provider’s GetAssembly method, if one exists. If no assembly is available at this point, it calls the GetAssembly method.

Examples

The following code demonstrates how to call this method with a provider-specific assembly string and then retrieve a string resource from the assembly.

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);
    }
}

Permissions

See Also

Reference

IVsDataProvider Interface

IVsDataProvider Members

GetAssembly Overload

Microsoft.VisualStudio.Data.Core Namespace