PowerTCP Zip Compression for .NET
SynchronizingObject Property




Set this object to automatically control thread marshalling between worker threads and the main UI thread.
Syntax
<DefaultValueAttribute()>
<DescriptionAttribute("Gets or sets the object used to marshal event-handler calls when they are raised.")>
<CategoryAttribute("Archive")>
Public Property SynchronizingObject As ISynchronizeInvoke
Dim instance As Archive
Dim value As ISynchronizeInvoke
 
instance.SynchronizingObject = value
 
value = instance.SynchronizingObject
[DefaultValue()]
[Description("Gets or sets the object used to marshal event-handler calls when they are raised.")]
[Category("Archive")]
public ISynchronizeInvoke SynchronizingObject {get; set;}
[DefaultValue()]
[Description("Gets or sets the object used to marshal event-handler calls when they are raised.")]
[Category("Archive")]
public: __property ISynchronizeInvoke* get_SynchronizingObject();
public: __property void set_SynchronizingObject( 
   ISynchronizeInvoke* value
);
[DefaultValue()]
[Description("Gets or sets the object used to marshal event-handler calls when they are raised.")]
[Category("Archive")]
public:
property ISynchronizeInvoke^ SynchronizingObject {
   ISynchronizeInvoke^ get();
   void set (    ISynchronizeInvoke^ value);
}

Property Value

If used, the main UI thread object; null if unused.
Remarks

Any application that (1) uses multithreading (for example, an application which uses an asynchronous BeginXXX method) and (2) must update a shared UI element on the main UI thread (such as a ListView object) from one of these worker threads must set this property to the value of the main UI thread object. If the application meets both of these requirements and this property is NOT set, you may see strange behavior in your application (such as strange exceptions or improper UI element values).

If you do not know whether or not you need to use this property, simply take the failsafe approach when programming Windows applications and always set this property to the Main Form object. If any thread marshalling has to occur between a worker thread and the UI thread, it will occur automatically.

Provides data for the CollectionChanged event. NOTE for server implementations: If you are using a PowerTCP server component to build a server application, you do not want to set this property (as it will cause the server application to become single-threaded). Instead, you want to use the Control.BeginInvoke method to thread-marshall to the main UI thread (see any of the installed sample server applications for an example of this).

See Also

Reference

Archive Class
Archive Members


PowerTCP Zip for .NET Documentation Version 2.1.1
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic