OPC Studio User's Guide and Reference
SharedInstance Property (EasyAEClient)



OpcLabs.EasyOpcClassicComponents Assembly > OpcLabs.EasyOpc.AlarmsAndEvents Namespace > EasyAEClient Class : SharedInstance Property
A default, shared instance of the client object.
Syntax
'Declaration
 
<NotNullAttribute()>
Public Shared ReadOnly Property SharedInstance As EasyAEClient
'Usage
 
Dim value As EasyAEClient
 
value = EasyAEClient.SharedInstance
[NotNull()]
public static EasyAEClient SharedInstance {get;}
[NotNull()]
public:
static property EasyAEClient^ SharedInstance {
   EasyAEClient^ get();
}

Property Value

The value of this property cannot be null (Nothing in Visual Basic).

Remarks

Use this property with care, as its usability is limited. Its main use is for testing, and for non-library application code where just a single instance is sufficient.

The default instance is not suitable for Windows Forms or similar environments, where a specific System.Threading.SynchronizationContext may be used with each form.

We do not recommend to use the default instance for library code, due to conflicts that may arise if your library sets some instance parameters which may not be the same as what other libraries or th final application expects.

This method or property does not throw any exceptions, aside from execution exceptions such as System.Threading.ThreadAbortException or System.OutOfMemoryException.

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also