Click or drag to resize

DataContextProviderGetContextT Method

Returns data context of a given type.

Namespace:  Demo3D.PLC.Comms
Assembly:  PLC (in PLC.dll) Version: 15.0.2.11458
Syntax
C#
public static T GetContext<T>(
	this IDataContextProvider? contextProvider,
	T defaultContext = null
)

Parameters

contextProvider
Type: Demo3D.PLC.CommsIDataContextProvider
The context provider.
defaultContext (Optional)
Type: T
Value to return if the context provider cannot provide the required context.

Type Parameters

T
The type of contextual information required.

Return Value

Type: T
Data context of a given type, or the default value of T

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IDataContextProvider. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also