QuickOPC User's Guide and Reference
GetServiceByName Method (IServiceProviderExtension)

OpcLabs.BaseLib Assembly > OpcLabs.BaseLib.Extensions Namespace > IServiceProviderExtension Class : GetServiceByName Method
The service provider.
The name of the type of service object to get.
Gets the service object of the specified type, given by type name.
Public Shared Function GetServiceByName( _
   ByVal serviceProvider As IServiceProvider, _
   ByVal serviceTypeName As String _
) As Object
Dim serviceProvider As IServiceProvider
Dim serviceTypeName As String
Dim value As Object
value = IServiceProviderExtension.GetServiceByName(serviceProvider, serviceTypeName)
public static object GetServiceByName( 
   IServiceProvider serviceProvider,
   string serviceTypeName
static Object^ GetServiceByName( 
   IServiceProvider^ serviceProvider,
   String^ serviceTypeName


The service provider.
The name of the type of service object to get.

Return Value

A service object of type given by serviceTypeName.
null if there is no service object of given type.

Target Platforms: .NET Framework: Windows 7 with SP1, Windows Server 2012; .NET Core: Linux, Microsoft Windows

See Also


IServiceProviderExtension Class
IServiceProviderExtension Members