Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello,
I'm trying to build a QueuedTask correctly. This should be a writing error.
I think in this case there is no need to explain what the application is. (Application for ArcGIS PRO)
I will be happy for any advice or help.

Thank you

What I have tried:

C#
protected override async void OnClick()
        {
            FeatureLayer fl = MapView.Active.Map.FindLayers("O_Klad_ZTM10").First() as FeatureLayer;
            if (fl == null)
                return;

            QueuedTask.Run(() = >//I have five mistakes here(Error	CS1026	) expected,	Error	CS1002	; expected,	Error	CS1525	Invalid expression term ')'	,Error	CS1525	Invalid expression term '>',Error	CS1525	Invalid expression term '{'	)


            {
                QueryFilter qf = new QueryFilter();
                string whereClause = "ZTM10_nom LIKE '0602%'";
                qf.WhereClause = whereClause;
                fl.Select(qf);

            });// and here one mistake (Error	CS1513	} expected)


            var rozsah = 200;
            CalculateBuffer(fl, @"D:\buffers.shp", rozsah, "Meters");
        }
Posted
Updated 14-Oct-21 23:37pm
v2
Comments
lmoelleb 15-Oct-21 4:51am    
What is QueuedTask? Sure I can take a guess and think it is some ArcGIS stuff based on other bits of the code - but it should not be necessary for readers of your question having to guess something as fundamental as this. And why not write what the 5 errors are - they are likely generic, meaning even programmers not using ArcGIS could help you.
dejf111 15-Oct-21 5:09am    
I tried to improve the field of your advice. Is it better?
Richard MacCutchan 15-Oct-21 5:39am    
What is difficult about using copy & paste to show error messages?
dejf111 15-Oct-21 5:50am    
Isn't that enough for you there?

1 solution

Quote:
C#
QueuedTask.Run(() = >
That's not a valid C# lambda method. You need to remove the space between the = and the >:
C#
QueuedTask.Run(() =>
Lambda expressions - C# reference | Microsoft Docs[^]
 
Share this answer
 
Comments
dejf111 15-Oct-21 5:49am    
I was really looking for a mistake where it wasn't and was it just this? Oh no

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900