Skip to content

Commit

Permalink
Remove instances of '#if NET6_0_OR_GREATER' (#24126)
Browse files Browse the repository at this point in the history
We're way past that, so deleting these unused cases.
  • Loading branch information
Eilon authored Aug 10, 2024
1 parent 8363dcf commit 27b00f1
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
using AListView = Android.Widget.ListView;
using AView = Android.Views.View;
using Microsoft.Maui.Controls.Platform;
#if NET6_0_OR_GREATER
using AMenu = Android.Views.IMenu;
#else
using AMenu = Android.Views.Menu;
#endif

namespace Microsoft.Maui.Controls.Compatibility.Platform.Android
{
Expand Down
15 changes: 2 additions & 13 deletions src/Controls/samples/Controls.Sample/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Maui.Controls.Sample.Pages;
using Maui.Controls.Sample.Services;
using Maui.Controls.Sample.ViewModels;
using Microsoft.AspNetCore.Components.WebView.Maui;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
Expand All @@ -21,11 +22,6 @@
using Microsoft.Maui.Controls.Compatibility.Hosting;
#endif


#if NET6_0_OR_GREATER
using Microsoft.AspNetCore.Components.WebView.Maui;
#endif

#if ANDROID
using Android.Gms.Common;
using Android.Gms.Maps;
Expand Down Expand Up @@ -112,11 +108,9 @@ public static MauiApp CreateMauiApp()
{"Logging:LogLevel:Default", "Warning"}
});

#if NET6_0_OR_GREATER
services.AddMauiBlazorWebView();
#if DEBUG
services.AddBlazorWebViewDeveloperTools();
#endif
#endif

services.AddLogging(logging =>
Expand Down Expand Up @@ -147,12 +141,7 @@ public static MauiApp CreateMauiApp()
PageType.Main => typeof(CustomNavigationPage),
PageType.FlyoutPage => typeof(CustomFlyoutPage),
PageType.TabbedPage => typeof(Pages.TabbedPageGallery),
PageType.Blazor =>
#if NET6_0_OR_GREATER
typeof(BlazorPage),
#else
throw new NotSupportedException("Blazor requires .NET 6 or higher."),
#endif
PageType.Blazor => typeof(BlazorPage),
_ => throw new Exception(),
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using Maui.Controls.Sample.Pages.Base;

#if NET6_0_OR_GREATER
using Maui.Controls.Sample.Pages.Blazor;
using Microsoft.AspNetCore.Components.Web;
#endif

namespace Maui.Controls.Sample.Pages
{
Expand All @@ -13,9 +10,7 @@ public BlazorPage()
{
InitializeComponent();

#if NET6_0_OR_GREATER
bwv.RootComponents.RegisterForJavaScript<MyDynamicComponent>("my-dynamic-root-component");
#endif
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ public MainViewModel(IConfiguration configuration, ITextService textService, IDi

protected override IEnumerable<SectionModel> CreateItems() => new[]
{
#if NET6_0_OR_GREATER
new SectionModel(typeof(BlazorPage), "Blazor",
"The BlazorWebView control allow to easily embed Razor components into native UI."),
#endif

new SectionModel(typeof(CompatibilityPage), "Compatibility",
"Functionality available using the compatibility package."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
using AListView = Android.Widget.ListView;
using AView = Android.Views.View;
using Microsoft.Maui.Controls.Platform;
#if NET6_0_OR_GREATER
using AMenu = Android.Views.IMenu;
#else
using AMenu = Android.Views.Menu;
#endif

namespace Microsoft.Maui.Controls.Handlers.Compatibility
{
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/src/Core/Interactivity/PlatformBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using PlatformView = Microsoft.UI.Xaml.FrameworkElement;
#elif TIZEN
using PlatformView = Tizen.NUI.BaseComponents.View;
#elif NET6_0_OR_GREATER || (NETSTANDARD || !PLATFORM)
#elif NETSTANDARD || !PLATFORM
using PlatformView = System.Object;
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using PlatformView = Android.Views.View;
#elif WINDOWS
using PlatformView = Microsoft.UI.Xaml.FrameworkElement;
#elif NET6_0_OR_GREATER || (NETSTANDARD || !PLATFORM)
#elif NETSTANDARD || !PLATFORM
using PlatformView = System.Object;
#endif

Expand Down

0 comments on commit 27b00f1

Please sign in to comment.