51 строка
1.7 KiB
C#
51 строка
1.7 KiB
C#
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
using System.Reflection.Metadata;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace Microsoft.ReactNative.Managed
|
|
{
|
|
public struct ReactSettingsSnapshot
|
|
{
|
|
public string BundleRootPath => IsValid ? Handle.BundleRootPath : null;
|
|
|
|
public string DebugBundlePath => IsValid ? Handle.DebugBundlePath : null;
|
|
|
|
public bool DebuggerBreakOnNextLine => IsValid ? Handle.DebuggerBreakOnNextLine : false;
|
|
|
|
public ushort DebuggerPort => IsValid ? Handle.DebuggerPort : (ushort)0;
|
|
|
|
public string JavaScriptBundleFile => IsValid ? Handle.JavaScriptBundleFile : null;
|
|
|
|
public string BundleAppId => IsValid ? Handle.BundleAppId : null;
|
|
|
|
public bool RequestInlineSourceMap => IsValid ? Handle.RequestInlineSourceMap : false;
|
|
|
|
public string SourceBundleHost => IsValid ? Handle.SourceBundleHost : null;
|
|
|
|
public ushort SourceBundlePort => IsValid ? Handle.SourceBundlePort : (ushort)0;
|
|
|
|
public bool UseDirectDebugger => IsValid ? Handle.UseDirectDebugger : false;
|
|
|
|
public bool UseFastRefresh => IsValid ? Handle.UseFastRefresh : false;
|
|
|
|
#pragma warning disable 612, 618 // Deprecated
|
|
public bool UseWebDebugger => IsValid ? Handle.UseWebDebugger : false;
|
|
#pragma warning restore 612, 618
|
|
|
|
public bool RequestDevBundle => IsValid ? Handle.RequestDevBundle : true;
|
|
|
|
public IReactSettingsSnapshot Handle { get; }
|
|
|
|
public bool IsValid => Handle != null;
|
|
|
|
public static explicit operator bool(ReactSettingsSnapshot settingsSnapshot) => settingsSnapshot.IsValid;
|
|
|
|
public ReactSettingsSnapshot(IReactSettingsSnapshot handle = null)
|
|
{
|
|
Handle = handle;
|
|
}
|
|
}
|
|
}
|