Hi,- The ArcGis extension is controlling a TCP/IP server such that the database path can be received from an XML sent over the network.
Calling ArcObjects from a thread other than the main threadIn many multithreading applications, you will need to make calls to ArcObjects from different running threads. For example, you might have a background thread that gets a response from a Web service, which, in turn, should add a new item to the map display, change the map extent, or run a geoprocessing (GP) tool to perform some type of analysis.A very common case is calling ArcObjects from a timer event handler method. A timer's elapsed event is raised on a ThreadPool task (a thread that is not the main thread). Yet it needs to use ArcObjects, which seems like it would require cross-apartment calls. However, this can be avoided by treating the ArcObjects component as if it were a UI control and using Invoke to delegate the call to the main thread where the ArcObjects component is created. Thus, no cross-apartment calls are made.The ISynchronizeInvoke interface includes the Invoke, BeginInvoke, and EndInvoke methods. Implementing these methods can be a daunting task. Instead, have your class directly inherit from System.Windows.Forms.Control or have a helper class that inherits Control. Either option provides a simple and efficient solution for invoking methods.The following code example uses a user-defined InvokeHelper class to invoke a timer�??s elapsed event handler to re-center the map's visible bounds and set the map's rotation.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.