Runtime enum should be in Oqtane,Shared

This commit is contained in:
hishamco 2020-11-19 17:33:49 +03:00
parent c44bc8709d
commit 322d45dd12
8 changed files with 21 additions and 12 deletions

View File

@ -87,7 +87,7 @@
private async Task Login() private async Task Login()
{ {
if (PageState.Runtime == Runtime.Server) if (PageState.Runtime == Oqtane.Shared.Runtime.Server)
{ {
// server-side Blazor // server-side Blazor
var user = new User(); var user = new User();

View File

@ -1,10 +1,10 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop; using Microsoft.JSInterop;
using Oqtane.Providers; using Oqtane.Providers;
using Oqtane.Services; using Oqtane.Services;
using Oqtane.UI; using Oqtane.Shared;
namespace Oqtane.Themes.Controls namespace Oqtane.Themes.Controls
{ {

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Oqtane.Models; using Oqtane.Models;
@ -19,6 +19,6 @@ namespace Oqtane.UI
public string Action { get; set; } public string Action { get; set; }
public bool EditMode { get; set; } public bool EditMode { get; set; }
public DateTime LastSyncDate { get; set; } public DateTime LastSyncDate { get; set; }
public Runtime Runtime { get; set; } public Oqtane.Shared.Runtime Runtime { get; set; }
} }
} }

View File

@ -1,5 +1,8 @@
namespace Oqtane.UI using System;
namespace Oqtane.UI
{ {
[Obsolete("This enum is deprecated and will be removed in the upcoming major release, please use Oqtane.Shared.Runtime instead.")]
public enum Runtime public enum Runtime
{ {
Server, Server,

View File

@ -560,8 +560,8 @@
return pageresources; return pageresources;
} }
private Runtime GetRuntime() private Oqtane.Shared.Runtime GetRuntime()
=> RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER")) => RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER"))
? Runtime.WebAssembly ? Oqtane.Shared.Runtime.WebAssembly
: Runtime.Server; : Oqtane.Shared.Runtime.Server;
} }

View File

@ -8,7 +8,6 @@ using Oqtane.Infrastructure;
using Oqtane.Modules; using Oqtane.Modules;
using Oqtane.Services; using Oqtane.Services;
using Oqtane.Shared; using Oqtane.Shared;
using Oqtane.UI;
// ReSharper disable once CheckNamespace // ReSharper disable once CheckNamespace
namespace Microsoft.Extensions.DependencyInjection namespace Microsoft.Extensions.DependencyInjection

View File

@ -21,7 +21,6 @@ using Oqtane.Repository;
using Oqtane.Security; using Oqtane.Security;
using Oqtane.Services; using Oqtane.Services;
using Oqtane.Shared; using Oqtane.Shared;
using Oqtane.UI;
namespace Oqtane namespace Oqtane
{ {

View File

@ -0,0 +1,8 @@
namespace Oqtane.Shared
{
public enum Runtime
{
Server,
WebAssembly
}
}