Skip to content

Commit

Permalink
utilnet: address build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jnery authored May 28, 2024
2 parents eb3774f + c10170f commit a6ee2c2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

namespace Esri.ArcGISRuntime.Toolkit.Maui;

public partial class UtilityNetworkTraceTool
#pragma warning disable CA1001
public partial class UtilityNetworkTraceTool
#pragma warning restore CA1001
{
#pragma warning disable SA1310, SX1309, SA1306
// Navigation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,9 @@ private void PART_RunTraceButton_Clicked(object? sender, EventArgs e)
private void OnAddStartingPointClicked(object? sender, EventArgs e) => _controller.IsAddingStartingPoints = !_controller.IsAddingStartingPoints;

private void PART_NetworksCollectionView_SelectionChanged(object? sender, EventArgs e)
{
if (PART_ListViewNetworks?.SelectedItem is UtilityNetwork newSelection)
{
_controller.SelectedUtilityNetwork = newSelection;
}
{
_controller.SelectedUtilityNetwork = PART_ListViewNetworks?.SelectedItem as UtilityNetwork;
UtilityNetworkChanged?.Invoke(this, new UtilityNetworkChangedEventArgs(_controller.SelectedUtilityNetwork));
}

private void UtilityNetworks_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
Expand Down Expand Up @@ -397,12 +395,15 @@ private void Results_CollectionChanged(object? sender, NotifyCollectionChangedEv
_resultOverlays.Add(item.ResultOverlay);
GeoView.GraphicsOverlays.Insert(0, item.ResultOverlay);
}

UtilityNetworkTraceCompleted?.Invoke(this, new UtilityNetworkTraceCompletedEventArgs(item.Parameters, item.RawResults));
if (item?.Error != null)

if (item.Error != null)
{
UtilityNetworkTraceCompleted?.Invoke(this, new UtilityNetworkTraceCompletedEventArgs(item.Parameters, item.Error));
}
else
{
UtilityNetworkTraceCompleted?.Invoke(this, new UtilityNetworkTraceCompletedEventArgs(item.Parameters, item.RawResults));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ namespace Esri.ArcGISRuntime.Toolkit.UI.Controls
#else
[TemplatePart(Name = "PART_TabsControl", Type = typeof(Pivot))]
#endif
#pragma warning disable CA1001
public partial class UtilityNetworkTraceTool
#pragma warning restore CA1001
{
private UIElement? _loadingScrim;
private UIElement? _ineligibleScrim;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,14 @@ private void Results_CollectionChanged(object? sender, NotifyCollectionChangedEv
GeoView.GraphicsOverlays.Insert(0, item.ResultOverlay);
}

UtilityNetworkTraceCompleted?.Invoke(this, new UtilityNetworkTraceCompletedEventArgs(item.Parameters, item.RawResults));
if (item?.Error != null)
if (item.Error != null)
{
UtilityNetworkTraceCompleted?.Invoke(this, new UtilityNetworkTraceCompletedEventArgs(item.Parameters, item.Error));
}
else
{
UtilityNetworkTraceCompleted?.Invoke(this, new UtilityNetworkTraceCompletedEventArgs(item.Parameters, item.RawResults));
}
}
}

Expand Down

0 comments on commit a6ee2c2

Please sign in to comment.