Skip to content

Commit b41fc68

Browse files
Fix build errors caused by Map namespace/class name ambiguity
Files in namespaces descending from AzureMapsControl.Components that import 'using AzureMapsControl.Components.Map;' had their using directives placed before the namespace declaration. Since 'Map' is also a sub-namespace of AzureMapsControl.Components, C# resolves the name 'Map' as the namespace before ever reaching the compilation-unit-level using directive. Fix: keep 'using AzureMapsControl.Components.Map;' after the namespace declaration (inside the namespace body) in the 29 files affected by this ambiguity. All other using directives remain before the namespace declaration. Also restored and properly transformed 7 Map test files that had been corrupted during prior bulk transformations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 122f890 commit b41fc68

32 files changed

Lines changed: 72 additions & 50 deletions

src/AzureMapsControl.Components/Animations/AnimationService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
using AzureMapsControl.Components.Data;
44
using AzureMapsControl.Components.Layers;
55
using AzureMapsControl.Components.Logger;
6-
using AzureMapsControl.Components.Map;
76
using AzureMapsControl.Components.Markers;
87
using AzureMapsControl.Components.Runtime;
98
using Microsoft.Extensions.Logging;
109

1110
namespace AzureMapsControl.Components.Animations;
1211

12+
using AzureMapsControl.Components.Map;
13+
1314
internal sealed class AnimationService : IAnimationService
1415
{
1516
private readonly IMapJsRuntime _jsRuntime;

src/AzureMapsControl.Components/Controls/OverviewMapControl.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
using System.Text.Json;
2-
using System.Text.Json.Serialization;
31
using AzureMapsControl.Components.Logger;
4-
using AzureMapsControl.Components.Map;
52
using AzureMapsControl.Components.Runtime;
63
using Microsoft.Extensions.Logging;
4+
using System.Text.Json;
5+
using System.Text.Json.Serialization;
76

87
namespace AzureMapsControl.Components.Controls;
98

9+
using AzureMapsControl.Components.Map;
10+
1011
public sealed class OverviewMapControl : Control<OverviewMapControlOptions>
1112
{
1213
internal override string Type => "overviewmap";

src/AzureMapsControl.Components/Controls/OverviewMapControlOptions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
using System.Diagnostics.CodeAnalysis;
21
using AzureMapsControl.Components.Atlas;
3-
using AzureMapsControl.Components.Map;
42
using AzureMapsControl.Components.Markers;
3+
using System.Diagnostics.CodeAnalysis;
54

65
namespace AzureMapsControl.Components.Controls;
76

7+
using AzureMapsControl.Components.Map;
8+
89
[ExcludeFromCodeCoverage]
910
public sealed class OverviewMapControlOptions : IControlOptions
1011
{

src/AzureMapsControl.Components/Controls/StyleControlOptions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
using System.Diagnostics.CodeAnalysis;
2-
using AzureMapsControl.Components.Map;
32

43
namespace AzureMapsControl.Components.Controls;
54

5+
using AzureMapsControl.Components.Map;
6+
67
/// <summary>
78
/// The options for a StyleControl object.
89
/// </summary>

src/AzureMapsControl.Components/Drawing/DrawingToolbarEventArgs.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
using System.Diagnostics.CodeAnalysis;
22
using AzureMapsControl.Components.Atlas;
3-
using AzureMapsControl.Components.Map;
43

54
namespace AzureMapsControl.Components.Drawing;
65

6+
using AzureMapsControl.Components.Map;
7+
78
[ExcludeFromCodeCoverage]
89
public sealed class DrawingToolbarEventArgs : MapEventArgs
910
{

src/AzureMapsControl.Components/Drawing/DrawingToolbarModeEventArgs.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
using System.Diagnostics.CodeAnalysis;
2-
using AzureMapsControl.Components.Map;
32

43
namespace AzureMapsControl.Components.Drawing;
54

5+
using AzureMapsControl.Components.Map;
6+
67
[ExcludeFromCodeCoverage]
78
public sealed class DrawingToolbarModeEventArgs : MapEventArgs
89
{

src/AzureMapsControl.Components/Layers/Layer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
using AzureMapsControl.Components.Exceptions;
22
using AzureMapsControl.Components.Logger;
3-
using AzureMapsControl.Components.Map;
43
using AzureMapsControl.Components.Runtime;
54
using Microsoft.Extensions.Logging;
65

76
namespace AzureMapsControl.Components.Layers;
87

8+
using AzureMapsControl.Components.Map;
9+
910
public delegate void LayerMouseEvent(MapMouseEventArgs eventArgs);
1011
public delegate void LayerTouchEvent(MapTouchEventArgs eventArgs);
1112
public delegate void LayerEvent(MapEventArgs eventArgs);

src/AzureMapsControl.Components/Layers/LayerEventInvokeHelper.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
using AzureMapsControl.Components.Events;
2-
using AzureMapsControl.Components.Map;
32

43
namespace AzureMapsControl.Components.Layers;
54

5+
using AzureMapsControl.Components.Map;
6+
67
internal sealed class LayerEventInvokeHelper : EventInvokeHelper<MapJsEventArgs>
78
{
89
public LayerEventInvokeHelper(Func<MapJsEventArgs, ValueTask> callback) : base(callback)

src/AzureMapsControl.Components/Markers/HtmlMarker.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
using Microsoft.JSInterop;
22
using AzureMapsControl.Components.Logger;
3-
using AzureMapsControl.Components.Map;
43
using AzureMapsControl.Components.Popups;
54
using AzureMapsControl.Components.Runtime;
65
using Microsoft.Extensions.Logging;
76

87
namespace AzureMapsControl.Components.Markers;
98

9+
using AzureMapsControl.Components.Map;
10+
1011
internal delegate void HtmlMarkerPopupToggledEvent();
1112
public delegate void HtmlMarkerEvent(HtmlMarkerEventArgs eventArgs);
1213

src/AzureMapsControl.Components/Markers/HtmlMarkerEventArgs.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
using System.Diagnostics.CodeAnalysis;
2-
using AzureMapsControl.Components.Map;
32

43
namespace AzureMapsControl.Components.Markers;
54

5+
using AzureMapsControl.Components.Map;
6+
67
[ExcludeFromCodeCoverage]
78
public sealed class HtmlMarkerEventArgs : MapEventArgs
89
{

0 commit comments

Comments
 (0)