diff --git a/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/DynamicServiceLayers/ArcGISDynamicMapServiceLayerLocalSample.xaml.cs b/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/DynamicServiceLayers/ArcGISDynamicMapServiceLayerLocalSample.xaml.cs index 45f10ed85a..4c7c6eef93 100644 --- a/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/DynamicServiceLayers/ArcGISDynamicMapServiceLayerLocalSample.xaml.cs +++ b/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/DynamicServiceLayers/ArcGISDynamicMapServiceLayerLocalSample.xaml.cs @@ -16,8 +16,6 @@ namespace ArcGISRuntimeSDKDotNet_DesktopSamples.Samples /// Dynamic Service Layers public partial class ArcGISDynamicMapServiceLayerLocalSample : UserControl { - - /// /// Initializes a new instance of the class. /// @@ -27,7 +25,7 @@ public ArcGISDynamicMapServiceLayerLocalSample() InitializeComponent(); - CreateLocalServiceAndDynamicLayer(); + var _ = CreateLocalServiceAndDynamicLayer(); } public async Task CreateLocalServiceAndDynamicLayer() @@ -44,7 +42,7 @@ public async Task CreateLocalServiceAndDynamicLayer() ServiceUri = localMapService.UrlMapService, }; - MyMapView.Map.Layers.Add(arcGISDynamicMapServiceLayer); + MyMapView.Map.Layers.Add(arcGISDynamicMapServiceLayer); } catch (Exception ex) { diff --git a/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/GeocodingTasks/GeocodeFullAddressInput.xaml.cs b/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/GeocodingTasks/GeocodeFullAddressInput.xaml.cs index 40c361a3a8..9e32f7c401 100644 --- a/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/GeocodingTasks/GeocodeFullAddressInput.xaml.cs +++ b/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/GeocodingTasks/GeocodeFullAddressInput.xaml.cs @@ -111,7 +111,7 @@ public GeocodeFullAddressInput() _candidateAddressesGraphicsLayer = map1.Layers["CandidateAddressesGraphicsLayer"] as GraphicsLayer; - SetSimpleRendererSymbols(); + var _ = SetSimpleRendererSymbols(); } private async Task SetSimpleRendererSymbols() @@ -132,7 +132,7 @@ private async Task SetSimpleRendererSymbols() _candidateAddressesGraphicsLayer.Renderer = findResultRenderer; } - private async Task SetupLocator() + private void SetupLocator() { if (!IsOnline) { @@ -142,7 +142,6 @@ private async Task SetupLocator() { _locatorTask = new OnlineLocatorTask(new Uri("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"), string.Empty); } - } private async void FindButton_Click(object sender, RoutedEventArgs e) diff --git a/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/GeocodingTasks/GeocodeSingleLineInput.xaml.cs b/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/GeocodingTasks/GeocodeSingleLineInput.xaml.cs index 404379a3ed..830055ddf4 100644 --- a/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/GeocodingTasks/GeocodeSingleLineInput.xaml.cs +++ b/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/GeocodingTasks/GeocodeSingleLineInput.xaml.cs @@ -93,13 +93,11 @@ public GeocodeSingleLineInput() _candidateAddressesGraphicsLayer = map1.Layers["CandidateAddressesGraphicsLayer"] as GraphicsLayer; - SetSimpleRendererSymbols(); + var _ = SetSimpleRendererSymbols(); } - private async Task SetSimpleRendererSymbols() { - PictureMarkerSymbol findResultMarkerSymbol = new PictureMarkerSymbol() { Width = 48, @@ -115,7 +113,7 @@ private async Task SetSimpleRendererSymbols() _candidateAddressesGraphicsLayer.Renderer = findResultRenderer; } - private async Task SetupLocator() + private void SetupLocator() { if (!IsOnline) { @@ -129,7 +127,6 @@ private async Task SetupLocator() private async void FindButton_Click(object sender, RoutedEventArgs e) { - _candidateAddressesGraphicsLayer.Graphics.Clear(); string text = SearchTextBox.Text; diff --git a/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/Mapping/LayersInitialized.xaml.cs b/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/Mapping/LayersInitialized.xaml.cs index bfda7dcdb3..5cc7b2ac0d 100644 --- a/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/Mapping/LayersInitialized.xaml.cs +++ b/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/Mapping/LayersInitialized.xaml.cs @@ -49,10 +49,10 @@ public LayersInitialized() InitializeComponent(); - HandleLayersInitialized(); + var _ = HandleLayersInitialized(); } - async Task HandleLayersInitialized() + private async Task HandleLayersInitialized() { var loadresult = await mapView1.LayersLoadedAsync(); LayersInitializedProperty = "Initialized!"; @@ -63,7 +63,6 @@ async Task HandleLayersInitialized() MessageBox.Show(string.Format("Layer {0} failed to load. {1} ", res.Layer.ID, res.LoadError.Message.ToString())); } } - } } } diff --git a/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/NetworkAnalystTasks/RoutingPointToPoint.xaml.cs b/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/NetworkAnalystTasks/RoutingPointToPoint.xaml.cs index a35f0a8ea5..1e6e34f4ed 100644 --- a/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/NetworkAnalystTasks/RoutingPointToPoint.xaml.cs +++ b/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/NetworkAnalystTasks/RoutingPointToPoint.xaml.cs @@ -141,7 +141,7 @@ public string EndLocationText string _localRoutingDatabase = @"..\..\..\..\..\samples-data\networks\san-diego\san-diego-network.geodatabase"; string _networkName = "Streets_ND"; - private async Task SetupRouteTask() + private void SetupRouteTask() { if (!IsOnline) { @@ -265,9 +265,16 @@ private async Task CalculateRoute() } - private void SolveRouteButton_Click(object sender, RoutedEventArgs e) + private async void SolveRouteButton_Click(object sender, RoutedEventArgs e) { - CalculateRoute(); + try + { + await CalculateRoute(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Sample Error"); + } } } } diff --git a/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/NetworkAnalystTasks/RoutingWithBarriers.xaml.cs b/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/NetworkAnalystTasks/RoutingWithBarriers.xaml.cs index 7c7a88e9bd..92fff2f54d 100644 --- a/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/NetworkAnalystTasks/RoutingWithBarriers.xaml.cs +++ b/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/NetworkAnalystTasks/RoutingWithBarriers.xaml.cs @@ -43,7 +43,7 @@ public bool IsOnline { _isOnline = value; - SetupRouteTask(); + var _ = SetupRouteTask(); if (PropertyChanged != null) { diff --git a/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/NetworkAnalystTasks/RoutingWithDirections.xaml.cs b/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/NetworkAnalystTasks/RoutingWithDirections.xaml.cs index ee582d050c..f2647e2951 100644 --- a/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/NetworkAnalystTasks/RoutingWithDirections.xaml.cs +++ b/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/NetworkAnalystTasks/RoutingWithDirections.xaml.cs @@ -170,7 +170,7 @@ public string Directions string _localRoutingDatabase = @"..\..\..\..\..\samples-data\networks\san-diego\san-diego-network.geodatabase"; string _networkName = "Streets_ND"; - private async Task SetupRouteTask() + private void SetupRouteTask() { if (!IsOnline) { @@ -301,9 +301,16 @@ private async Task CalculateRoute() } } - private void SolveRouteButton_Click(object sender, RoutedEventArgs e) + private async void SolveRouteButton_Click(object sender, RoutedEventArgs e) { - CalculateRoute(); + try + { + await CalculateRoute(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Sample Error"); + } } } }