Partager via


IVsDataSupport.OpenSupportStream Method

Opens and returns the stream of data support XML that is represented by the data support object.

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

Syntax

'Declaration
Function OpenSupportStream As Stream
Stream OpenSupportStream()
Stream^ OpenSupportStream()
abstract OpenSupportStream : unit -> Stream
function OpenSupportStream() : Stream

Return Value

Type: System.IO.Stream
An open stream containing the data support XML that is represented by the data support object.

Remarks

It is rare for a DDEX provider to explicitly implement this method, except in advanced scenarios that require dynamic generation of XML that depends on some particular context, like a data connection. Normally the XML is stored either on disk in a secure location or as a resource in the DDEX provider’s assembly. The DDEX framework provides built-in implementations for both of these scenarios that simply require the appropriate data to locate the XML file or resource.

Examples

The following code demonstrates a potential implementation of this interface in the context of supplying support for viewing the data source as a hierarchy of objects.

using System;
using System.IO;
using Microsoft.VisualStudio.Data.Core;
using Microsoft.VisualStudio.Data.Services.SupportEntities;

internal class MyViewSupport
    : IVsDataViewSupport // inherits from IVsDataSupport
{
    public Stream OpenSupportStream()
    {
        return GetType().Assembly.GetManifestResourceStream(
            "MyViewSupport.xml");
    }

    public void Close()
    {
    }

    public void Initialize()
    {
    }
}

.NET Framework Security

See Also

Reference

IVsDataSupport Interface

Microsoft.VisualStudio.Data.Core Namespace