Share via


DocDataTextWriter.IServiceProvider.GetService Method

Gets the service of the specified type.

Namespace:  Microsoft.VisualStudio.Shell.Design.Serialization
Assembly:  Microsoft.VisualStudio.Shell.Design (in Microsoft.VisualStudio.Shell.Design.dll)

Syntax

‘선언
Private Function GetService ( _
    serviceType As Type _
) As Object Implements IServiceProvider.GetService
‘사용 방법
Dim instance As DocDataTextWriter
Dim serviceType As Type
Dim returnValue As Object

returnValue = CType(instance, IServiceProvider).GetService(serviceType)
Object IServiceProvider.GetService(
    Type serviceType
)
private:
virtual Object^ GetService(
    Type^ serviceType
) sealed = IServiceProvider::GetService
private abstract GetService : 
        serviceType:Type -> Object 
private override GetService : 
        serviceType:Type -> Object 
JScript does not support explicit interface implementations.

Parameters

Return Value

Type: System.Object
The service.

Implements

IServiceProvider.GetService(Type)

Remarks

This method is implemented to allow objects that utilize this text writer to re-discover the original DocData it is associated with. In many instances redirecting through the System.IO classes doesn't allow enough fidelity. An example of this is when a text writer must write out the entire file instead of only writing out specific changed portions or portions of interest. The following services are provided:

typeof(DocData)
typeof(EnvDte.TextDocument) // If DocData supports it.

.NET Framework Security

See Also

Reference

DocDataTextWriter Class

DocDataTextWriter Members

Microsoft.VisualStudio.Shell.Design.Serialization Namespace