OPC Studio User's Guide and Reference
SynchronizationContext Property



OpcLabs.BaseLib Assembly > OpcLabs.BaseLib.Widgets Namespace > NotifyingWidget Class : SynchronizationContext Property
Contains synchronization context used by the object when performing asynchronous operations (including event notifications).
Syntax
'Declaration
 
<BrowsableAttribute(False)>
<CanBeNullAttribute()>
<XmlIgnoreAttribute()>
Public Property SynchronizationContext As SynchronizationContext
'Usage
 
Dim instance As NotifyingWidget
Dim value As SynchronizationContext
 
instance.SynchronizationContext = value
 
value = instance.SynchronizationContext
[Browsable(false)]
[CanBeNull()]
[XmlIgnore()]
public SynchronizationContext SynchronizationContext {get; set;}
[Browsable(false)]
[CanBeNull()]
[XmlIgnore()]
public:
property SynchronizationContext^ SynchronizationContext {
   SynchronizationContext^ get();
   void set (    SynchronizationContext^ value);
}

Property Value

The synchronization context that should be used for asynchronous operations. If null, the default synchronization context is used.

This value of this property can be null (Nothing in Visual Basic).

The default value of this property is null.

Remarks

This property allows for the specification of a custom synchronization context for managing the execution of asynchronous operations and event notifications. This can be particularly useful in environments with a specific threading model, such as UI applications where operations need to be marshaled back to the UI thread.

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