Share via


PosCommon.SynchronizingObject Property (POS for .NET v1.12 SDK Documentation)

2/27/2008

Gets or sets the object that is used to marshal the event handler calls issued because of a POS event.

Namespace: Microsoft.PointOfService
Assembly: Microsoft.PointOfService (in microsoft.pointofservice.dll)

Syntax

'Declaration
Public Property SynchronizingObject As ISynchronizeInvoke
public ISynchronizeInvoke SynchronizingObject { get; set; }
public:
property ISynchronizeInvoke^ SynchronizingObject {
    ISynchronizeInvoke^ get ();
    void set (ISynchronizeInvoke^ value);
}
/** @property */
public ISynchronizeInvoke get_SynchronizingObject ()

/** @property */
public void set_SynchronizingObject (ISynchronizeInvoke value)
public function get SynchronizingObject () : ISynchronizeInvoke

public function set SynchronizingObject (value : ISynchronizeInvoke)

Remarks

Holds an object that implements the .NET Framework class ISynchronoizeInvoke that is used to marshal events to a particular thread. If SynchronizingObject is set to null, events are raised on a system thread owned by the Service Object.

 

When the POS events are handled by a visual Windows Forms component, such as a Button, accessing the component through the Service Object thread might not work, or may result in an exception. Avoid this by setting SynchronizingObject to a Windows Forms component. This causes the methods that handle the POS events to be called on the same thread on which the component was created.

The PosExplorer class initializes the SynchronizingObject method to the value of its SynchronizingObject property. This allows applications to set the SynchronizingObject property on the PosExplorer class and make sure that all Service Objects that are created by that instance of PosExplorer deliver events on the same thread.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread-safe. Any instance members are not guaranteed to be thread-safe.

See Also

Reference

PosCommon Class
PosCommon Members
Microsoft.PointOfService Namespace
.NET Framework IsynchronizeInvoke
PosExplorer