{"id":8038,"date":"2025-09-04T23:22:34","date_gmt":"2025-09-05T04:22:34","guid":{"rendered":"https:\/\/librarytestdev.wpenginepowered.com\/?post_type=doc&#038;p=8038"},"modified":"2025-09-04T23:23:55","modified_gmt":"2025-09-05T04:23:55","slug":"tt-net-sdk-event-model","status":"publish","type":"doc","link":"https:\/\/library-staging.tradingtechnologies.com\/apis\/tt-net-sdk\/creating-the-application-framework\/tt-net-sdk-event-model\/","title":{"rendered":"TT .NET SDK event model"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">TT .NET SDK is inherently multi-threaded, using events to notify TT .NET SDK applications of new data, such as order status changes, price updates, or fill notifications. Because your applications can use multiple threads to access TT .NET SDK functionality, each thread that interacts with TT .NET SDK must have an attached Dispatcher object that routes events and data across threads.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">TT .NET SDK supports the following&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Dispatcher.html\">Dispatcher<\/a>&nbsp;types:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"\/tt-net-sdk\/api\/tt_net_sdk.UIDispatcher.html\">UIDispatcher<\/a>, which uses the Windows Message Queue to manage events for Windows Forms threads. You create and attach a\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.UIDispatcher.html\">UIDispatcher<\/a>\u00a0to the current thread as follows:<code>UIDispatcher m_disp = Dispatcher.AttachUIDispatcher();<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note<\/strong>: .NET 5 does not support a UIDispatcher.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"\/tt-net-sdk\/api\/tt_net_sdk.WorkerDispatcher.html\">WorkerDispatcher<\/a>, which uses the TT .NET SDK Message Queue to manage events for non-Windows Forms threads. You create and attach a\u00a0<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.WorkerDispatcher.html\">WorkerDispatcher<\/a>\u00a0to the current thread as follows:<code>WorkerDispatcher m_disp = Dispatcher.AttachWorkerDispatcher();<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Note that both the&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.UIDispatcher.html\">UIDispatcher<\/a>&nbsp;and&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.WorkerDispatcher.html\">WorkerDispatcher<\/a>&nbsp;classes derive from the&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.UIDispatcher.html\">UIDispatcher<\/a>&nbsp;class. You can always access your current&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Dispatcher.html\">Dispatcher<\/a>&nbsp;object in any TT .NET SDK thread by calling&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.Dispatcher.Current.html\">Dispatcher.Current<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"dispatcher-suggestions\"><a href=\"\/tt-net-sdk\/articles\/af-event-model.html#dispatcher-suggestions\"><\/a>Dispatcher Suggestions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.UIDispatcher.html\">UIDispatcher<\/a>&nbsp;is only supported on Windows Operating Systems. To support multiple platforms, the .NET 5 version of the TT .NET SDK does not support the&nbsp;<a href=\"\/tt-net-sdk\/api\/tt_net_sdk.UIDispatcher.html\">UIDispatcher<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">TT recommends writing a dispatcher to push messages to the UI thread for the specific operating system that will run the application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For Windows users, TT suggests users look into&nbsp;<a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/system.windows.threading.dispatcher\">System.Windows.Threading.Dispatcher<\/a>&nbsp;to push messages to the UI.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>TT .NET SDK is inherently multi-threaded, using events to notify TT .NET SDK applications of new data, such as [&hellip;]<\/p>\n","protected":false},"author":2,"template":"wp-custom-template-single-doc-tt-net-sdk","meta":{"_acf_changed":true,"footnotes":""},"docs-category":[770],"class_list":["post-8038","doc","type-doc","status-publish","hentry","docs-category-creating-the-application-framework"],"acf":[],"_links":{"self":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/8038","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc"}],"about":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/types\/doc"}],"author":[{"embeddable":true,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/users\/2"}],"version-history":[{"count":0,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/8038\/revisions"}],"wp:attachment":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/media?parent=8038"}],"wp:term":[{"taxonomy":"docs-category","embeddable":true,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/docs-category?post=8038"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}