Hello,
If I use the NWPath class as new
There is no constructor that specifies 2 arguments (Error CS1729).
Is there any workaround?
<Err Souce code>
public Test(IntPtr handle, bool owns)
{
NWPath npath = new NWPath(handle, owns) ; // Compiler Error CS1729
}
Visual Studio pro 2022
Version:17.7.1
Project:C#
---------------------------------------------
There is no constructor that specifies 2 arguments
public NWPath(IntPtr handle, bool owns);
<NWPath.cs>
// C:\Program Files\dotnet\packs\Microsoft.iOS.Ref\16.4.7089\ref\net7.0\Microsoft.iOS.dll
#endregion
#nullable enable
using CoreFoundation;
using ObjCRuntime;
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
namespace Network
{
[SupportedOSPlatform("tvos12.0")]
[SupportedOSPlatform("macos")]
[SupportedOSPlatform("ios12.0")]
[SupportedOSPlatform("maccatalyst")]
public class NWPath : NativeObject
{
public NWPathStatus Status { get; }
public bool IsExpensive { get; }
public bool HasIPV4 { get; }
public bool HasIPV6 { get; }
public bool HasDns { get; }
public NWEndpoint? EffectiveLocalEndpoint { get; }
public NWEndpoint? EffectiveRemoteEndpoint { get; }
[SupportedOSPlatform("tvos13.0")]
[SupportedOSPlatform("macos10.15")]
[SupportedOSPlatform("ios13.0")]
[SupportedOSPlatform("maccatalyst")]
public bool IsConstrained { get; }
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Use the overload that takes a 'Func<NWEndpoint, bool>' instead.")]
[SupportedOSPlatform("tvos13.0")]
[SupportedOSPlatform("macos10.15")]
[SupportedOSPlatform("ios13.0")]
[SupportedOSPlatform("maccatalyst")]
public void EnumerateGateways(Action<NWEndpoint> callback);
[BindingImpl(BindingImplOptions.Optimizable)]
[SupportedOSPlatform("tvos13.0")]
[SupportedOSPlatform("macos10.15")]
[SupportedOSPlatform("ios13.0")]
[SupportedOSPlatform("maccatalyst")]
public void EnumerateGateways(Func<NWEndpoint, bool> callback);
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Use the overload that takes a 'Func<NWInterface, bool>' instead.")]
public void EnumerateInterfaces(Action<NWInterface> callback);
[BindingImpl(BindingImplOptions.Optimizable)]
public void EnumerateInterfaces(Func<NWInterface, bool> callback);
public bool EqualsTo(NWPath other);
[SupportedOSPlatform("ios14.2")]
[SupportedOSPlatform("tvos14.2")]
[SupportedOSPlatform("macos11.0")]
[SupportedOSPlatform("maccatalyst14.2")]
public NWPathUnsatisfiedReason GetUnsatisfiedReason();
public bool UsesInterfaceType(NWInterfaceType type);
}
}
---------------------------------------------
Best Regards,