最近在研究ArcGIS Runtime,被下面代码中的这个符号搞晕了() =>,总感觉这是一个函数,去微软的网站查了查,果不其然,这个也算一个新的东西吧,学习了,感谢群友的帮忙。
LocalServer.InitializeAsync(() =>
{
if (LocalServer.LicenseStatus != LicenseStatus.Valid)
{
MessageBox.Show("This ArcGIS Runtime license is not valid");
}
_graphicsLayer = MyMap.Layers["GraphicsLayer"] as GraphicsLayer;
_drawFeatures = new Draw(MyMap);
_drawFeatures.DrawComplete += new EventHandler<DrawEventArgs>(_drawFeatures_DrawComplete);
_localPointtoPointRouting = new LocalGeoprocessingService(_packageFolder + @"PointToPointWBarriers.gpk", GPServiceType.Execute);
_localPointtoPointRouting.StartAsync((callback) =>
{
if (callback.Error != null)
MessageBox.Show("Error creating local GP service:\n" + callback.Error.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
else
{
StartLocationButton.IsEnabled = true;
StopLocationButton.IsEnabled = true;
CreateRoute.IsEnabled = true;
}
});
});