<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using a function in QueuedTask.Run in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-a-function-in-queuedtask-run/m-p/818485#M2723</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A href="https://community.esri.com/migrated-users/19690"&gt;Berndt Nording&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;Great to hear that you are beginning your work migrating your add-ins to Pro, and found your way here to the group.&amp;nbsp; I saw that you mentioned that you had not found many resources yet, and wanted to make sure you are aware of these as you get started:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;First, there is a Getting Started document on&lt;STRONG&gt; &lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Migrating-to-ArcGIS-Pro"&gt;Migrating to ArcGIS Pro&lt;/A&gt;&lt;/STRONG&gt; with links to many of the key Pro SDK resources, including documentation, the API reference, community samples, instructor-led training, etc.&lt;/LI&gt;&lt;LI&gt;Your question above around&amp;nbsp;QueuedTask is discussed in detail in the &lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#working-with-multithreading-in-arcgis-pro"&gt;&lt;STRONG&gt;Framework&lt;/STRONG&gt; &lt;/A&gt;document which is a key ProConcepts document as you get started.&lt;/LI&gt;&lt;LI&gt;The &lt;STRONG&gt;&lt;A href="https://github.com/esri/arcgis-pro-sdk-community-samples"&gt;community samples&lt;/A&gt;&lt;/STRONG&gt; are an important resource for learning the SDK patterns, and there are 175+ solutions, and you can download all of them as a zipfile and use all of the code in your own work.&lt;/LI&gt;&lt;LI&gt;You can find quick links to many of the documents above from the SDK&lt;STRONG&gt; &lt;A href="https://pro.arcgis.com/en/pro-app/sdk/"&gt;landing page&lt;/A&gt;.&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;Finally the Pro SDK videos from Dev Summit are an excellent resource with best practices and patterns as you get started, and&lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-pro/announcements/arcgis-pro-sdk-sessions-available-from-dev-summit-2020/"&gt;&lt;STRONG&gt; this blog post&lt;/STRONG&gt; &lt;/A&gt;includes the full list and a youtube playlist.&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Jun 2020 17:52:28 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2020-06-09T17:52:28Z</dc:date>
    <item>
      <title>Using a function in QueuedTask.Run</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-a-function-in-queuedtask-run/m-p/818482#M2720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working on converting some of my ArcMap addins to work in Pro.&amp;nbsp; Rather steep learning curve given that is no ESRI guidance at all on doing this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have found that you can't do anything with geodatabases without wrapping it into an asynchronous function. I managed to find some sample code and wrote a test addin that lists all the featureclasses in a geodatabase.&lt;/P&gt;&lt;P&gt;The code below actually works, but is really messy with the inline defined "lambda" function. I should be able to clean it up with a separate function as in the commented out lines in the code, but am having trouble properly constructing the code.&lt;/P&gt;&lt;P&gt;The IDE tells me QueuedTask.run wants an "action" and not the function I passed it, so I don't know where to go from there.&lt;/P&gt;&lt;P&gt;I also found that I needed to add "async" to the addin button's onclick override to make it work, but that was a shot in the dark as none of the documentation or samples showed this, so I don't know if this is the proper way to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Friend Class Sample
    Inherits Button
    Dim m_gdbPath As String = "F:\HIES\CnmiImagery\CnmiImagery.gdb"

    Protected Overrides Async Sub OnClick()
        Dim strMsgs As String = ""
        Try
            'strMsgs += Await QueuedTask.Run(getDefs())

            strMsgs += Await QueuedTask.Run(Function()
                                                Dim msg As String = ""
                                                Using gdb As New Geodatabase(New FileGeodatabaseConnectionPath(New Uri(m_gdbPath, UriKind.Absolute)))
                                                    Dim defs As IReadOnlyList(Of TableDefinition) = gdb.GetDefinitions(Of FeatureClassDefinition)()
                                                    For Each fdsDef As FeatureClassDefinition In defs
                                                        msg += fdsDef.GetName &amp;amp; vbCrLf
                                                    Next
                                                End Using
                                                Return msg
                                            End Function)
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
        MsgBox(strMsgs)
    End Sub

    'Function getDefs() As String
    '    Dim msg As String = ""
    '    Using gdb As New Geodatabase(New FileGeodatabaseConnectionPath(New Uri(m_gdbPath, UriKind.Absolute)))
    '        Dim defs As IReadOnlyList(Of TableDefinition) = gdb.GetDefinitions(Of FeatureClassDefinition)()

    '        For Each fdsDef As FeatureClassDefinition In defs
    '            msg += fdsDef.GetName &amp;amp; vbCrLf
    '            'Console.WriteLine(TableString(fdsDef As TableDefinition))
    '        Next
    '    End Using
    '    Return msg
    'End Function
End Class&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:41:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-a-function-in-queuedtask-run/m-p/818482#M2720</guid>
      <dc:creator>BerndtNording</dc:creator>
      <dc:date>2021-12-12T09:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using a function in QueuedTask.Run</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-a-function-in-queuedtask-run/m-p/818483#M2721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Berndt.&lt;/P&gt;&lt;P&gt;Have you tried like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;strMsgs += Await QueuedTask.Run(Return getDefs())&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;I don't know VB Net syntax, but you must return value from your QueedTask.Run.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;Another way:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strMsgs += Await QueuedTask.Run(Function()&lt;BR style="color: #000000; font-family: monospace; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;" /&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return getDefs()&lt;/SPAN&gt;&lt;BR style="color: #000000; font-family: monospace; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;" /&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Function)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;In c# we use {} instead of Function() End Function.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;About await and async. You can use Result from QueedTask.Run. Then you do not need add async. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;Like this:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strMsgs += QueuedTask.Run(Function()&lt;BR style="color: #000000; font-family: monospace; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;" /&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;/SPAN&gt;&lt;BR style="color: #000000; font-family: monospace; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;" /&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Function).Result&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;I found info for c# but I think it could be suitable and for VB Net:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; color: #b00000; white-space: pre; font-weight: inherit; display: inline !important; letter-spacing: normal; text-decoration: none; font-size: 100%; font-style: inherit; float: none; background-color: #f5f2f0; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; font-family: monospace; orphans: 2; text-align: left; "&gt;&lt;A href="https://www.exprodat.com/blogs/33195/"&gt;https://www.exprodat.com/blogs/33195/&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&lt;SPAN style="-webkit-text-stroke-width: 0px; color: #b00000; white-space: pre; font-weight: inherit; display: inline !important; letter-spacing: normal; text-decoration: none; font-size: 100%; font-style: inherit; float: none; background-color: #f5f2f0; text-transform: none; word-spacing: 0px; font-variant: normal; text-indent: 0px; font-family: monospace; orphans: 2; text-align: left; "&gt;(&lt;SPAN style="color: #007600; font-family: monospace; background-color: #f5f2f0;"&gt;Enabling Edit and Continue&lt;/SPAN&gt; section)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2020 07:20:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-a-function-in-queuedtask-run/m-p/818483#M2721</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2020-06-09T07:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using a function in QueuedTask.Run</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-a-function-in-queuedtask-run/m-p/818484#M2722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much, Gintautas!&lt;/P&gt;&lt;P&gt;The first suggestion didn't work, but the second one did. It could be further cleaned up as&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;strMsgs += Await QueuedTask.Run(Function() getDefs())&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And your suggestion for getting rid of the Async modifier worked a treat. Awesome!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2020 16:30:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-a-function-in-queuedtask-run/m-p/818484#M2722</guid>
      <dc:creator>BerndtNording</dc:creator>
      <dc:date>2020-06-09T16:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using a function in QueuedTask.Run</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-a-function-in-queuedtask-run/m-p/818485#M2723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A href="https://community.esri.com/migrated-users/19690"&gt;Berndt Nording&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;Great to hear that you are beginning your work migrating your add-ins to Pro, and found your way here to the group.&amp;nbsp; I saw that you mentioned that you had not found many resources yet, and wanted to make sure you are aware of these as you get started:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;First, there is a Getting Started document on&lt;STRONG&gt; &lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Migrating-to-ArcGIS-Pro"&gt;Migrating to ArcGIS Pro&lt;/A&gt;&lt;/STRONG&gt; with links to many of the key Pro SDK resources, including documentation, the API reference, community samples, instructor-led training, etc.&lt;/LI&gt;&lt;LI&gt;Your question above around&amp;nbsp;QueuedTask is discussed in detail in the &lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#working-with-multithreading-in-arcgis-pro"&gt;&lt;STRONG&gt;Framework&lt;/STRONG&gt; &lt;/A&gt;document which is a key ProConcepts document as you get started.&lt;/LI&gt;&lt;LI&gt;The &lt;STRONG&gt;&lt;A href="https://github.com/esri/arcgis-pro-sdk-community-samples"&gt;community samples&lt;/A&gt;&lt;/STRONG&gt; are an important resource for learning the SDK patterns, and there are 175+ solutions, and you can download all of them as a zipfile and use all of the code in your own work.&lt;/LI&gt;&lt;LI&gt;You can find quick links to many of the documents above from the SDK&lt;STRONG&gt; &lt;A href="https://pro.arcgis.com/en/pro-app/sdk/"&gt;landing page&lt;/A&gt;.&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;Finally the Pro SDK videos from Dev Summit are an excellent resource with best practices and patterns as you get started, and&lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-pro/announcements/arcgis-pro-sdk-sessions-available-from-dev-summit-2020/"&gt;&lt;STRONG&gt; this blog post&lt;/STRONG&gt; &lt;/A&gt;includes the full list and a youtube playlist.&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2020 17:52:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-a-function-in-queuedtask-run/m-p/818485#M2723</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-06-09T17:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using a function in QueuedTask.Run</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-a-function-in-queuedtask-run/m-p/818486#M2724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Christopher,&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks for responding. Yes, I have already studied the "Migrating to ArcGIS Pro" document, In fact I was quite thrilled to find it, and then very disappointed when I looked at the content. "Migration" is not addressed at all, this is truly a "Getting Started" (from scratch) document. For those of us that have spent years learning, developing, and refining our knowledge of customizing ArcGIS UnPro (ArcMap), there is little if anything that helps us apply those hard-won skills to migrating. Clearly, while Pro is a completely different animal and many things are different, there are still many concepts and approaches that are still the exactly the same even if they are just sporting new names and terminology.&lt;/P&gt;&lt;P&gt;&amp;nbsp; And yes, what I have been able to do so far has been because of the community samples. Indeed, samples are the lifeblood of a GIS Engineer that needs to have many GIS skills that are not programming related, yet still needs to use programming as just another tool to accomplish a larger task by cobbling together bits and pieces borrowed from samples.&lt;/P&gt;&lt;P&gt;&amp;nbsp;I am looking forward to the resumption of real (not online) instructor-led training.&lt;/P&gt;&lt;P&gt;I have looked at several of the DevSummit videos, and even paused them to painstakingly copy some code to a file. It would be great if any code from these videos were made available digitally. Please don't mention PDF, the bane of all GIS datahounds.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2020 19:58:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-a-function-in-queuedtask-run/m-p/818486#M2724</guid>
      <dc:creator>BerndtNording</dc:creator>
      <dc:date>2020-06-09T19:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using a function in QueuedTask.Run</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-a-function-in-queuedtask-run/m-p/818487#M2725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your feedback, Berndt, and glad you found that document.&amp;nbsp; We've tried to include the high-level topics which are normally helpful to new Pro developers as they look to migrate or get started from scratch, and these mainly are getting started concepts. Sounds like you're very familiar with many of the resources and great news that you found the samples.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On your question on the DevSummit videos -- yes, the team has recently been making these available, and you can find the individual SDK session materials&amp;nbsp;at this page:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/tech-sessions"&gt;https://github.com/esri/arcgis-pro-sdk/wiki/tech-sessions&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2020 21:58:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-a-function-in-queuedtask-run/m-p/818487#M2725</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-06-09T21:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using a function in QueuedTask.Run</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-a-function-in-queuedtask-run/m-p/1592403#M12709</link>
      <description>&lt;P&gt;Just be aware that&amp;nbsp; adding&amp;nbsp;&lt;SPAN&gt;.Result causes the thread to wait until a Result is available to assign to strMsgs.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2025 18:53:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-a-function-in-queuedtask-run/m-p/1592403#M12709</guid>
      <dc:creator>RichardDaniels</dc:creator>
      <dc:date>2025-03-05T18:53:56Z</dc:date>
    </item>
  </channel>
</rss>

