[src] Make sure the (IntPtr/NativeHandle, bool) ctor is always preserved (conditionally) for types that subclass NativeObject. Fixes #13699. (#13708)
Also add test to make sure we never forget again. Fixes https://github.com/xamarin/xamarin-macios/issues/13699.
This commit is contained in:
Родитель
8050ca36ed
Коммит
a34ca54cc2
|
@ -166,6 +166,7 @@ namespace AddressBook {
|
|||
return new ABAddressBook (handle, true);
|
||||
}
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal ABAddressBook (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -97,6 +97,7 @@ namespace AddressBook {
|
|||
Handle = ABGroupCreateInSource (source.Handle);
|
||||
}
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal ABGroup (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -219,6 +219,7 @@ namespace AddressBook {
|
|||
internal Converter<NativeHandle, T> toManaged;
|
||||
internal Converter<T, NativeHandle> toNative;
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal ABMultiValue (NativeHandle handle, bool owns)
|
||||
: this (handle,
|
||||
v => (T) (object) Runtime.GetNSObject (v)!,
|
||||
|
@ -315,6 +316,7 @@ namespace AddressBook {
|
|||
#endif
|
||||
public class ABMutableMultiValue<T> : ABMultiValue<T>
|
||||
{
|
||||
[Preserve (Conditional = true)]
|
||||
internal ABMutableMultiValue (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -621,6 +621,7 @@ namespace AddressBook {
|
|||
{
|
||||
}
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal ABPerson (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -58,6 +58,7 @@ namespace AddressBook {
|
|||
#endif
|
||||
#endif
|
||||
public class ABSource : ABRecord {
|
||||
[Preserve (Conditional = true)]
|
||||
internal ABSource (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -102,6 +102,7 @@ namespace AudioToolbox
|
|||
|
||||
public event AudioConverterComplexInputData? InputData;
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal AudioConverter (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -565,6 +565,7 @@ namespace AudioToolbox {
|
|||
}
|
||||
#endif
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal AudioFile (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -83,6 +83,7 @@ namespace AudioToolbox {
|
|||
[DllImport (Constants.AudioToolboxLibrary)]
|
||||
extern static /* OSStatus */ MusicPlayerStatus DisposeMusicPlayer (/* MusicPlayer */ IntPtr inPlayer);
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
MusicPlayer (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -43,6 +43,7 @@ namespace AudioToolbox {
|
|||
public class MusicSequence : DisposableObject
|
||||
{
|
||||
#if !COREBUILD
|
||||
[Preserve (Conditional = true)]
|
||||
internal MusicSequence (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -235,6 +235,7 @@ namespace AudioUnit
|
|||
|
||||
public class AudioComponent : DisposableObject {
|
||||
#if !COREBUILD
|
||||
[Preserve (Conditional = true)]
|
||||
internal AudioComponent (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -313,6 +313,7 @@ namespace AudioUnit
|
|||
Dictionary<uint, RenderDelegate>? renderer;
|
||||
Dictionary<uint, InputDelegate>? inputs;
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal AudioUnit (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
@ -1044,6 +1045,7 @@ namespace AudioUnit
|
|||
{
|
||||
}
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal AURenderEventEnumerator (NativeHandle handle, bool owns)
|
||||
{
|
||||
Handle = handle;
|
||||
|
|
|
@ -28,6 +28,7 @@ namespace CoreServices {
|
|||
#endif
|
||||
|
||||
public class CFHTTPAuthentication : CFType {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CFHTTPAuthentication (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -31,6 +31,7 @@ namespace CoreServices {
|
|||
#endif
|
||||
|
||||
public partial class CFHTTPMessage : CFType {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CFHTTPMessage (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -34,6 +34,7 @@ namespace CoreServices {
|
|||
#endif
|
||||
public partial class CFHTTPStream : CFReadStream {
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal CFHTTPStream (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -50,6 +50,7 @@ namespace CoreServices {
|
|||
#endif
|
||||
#endif
|
||||
class CFHost : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CFHost (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -59,6 +59,7 @@ namespace CoreFoundation {
|
|||
}
|
||||
#endif
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal CFAllocator (NativeHandle handle, bool owns)
|
||||
#else
|
||||
|
|
|
@ -37,6 +37,7 @@ namespace CoreFoundation {
|
|||
public string Creator { get; private set; }
|
||||
}
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal CFBundle (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -40,6 +40,7 @@ using NativeHandle = System.IntPtr;
|
|||
namespace CoreFoundation {
|
||||
|
||||
class CFData : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CFData (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace CoreFoundation {
|
|||
public static IntPtr KeyCallbacks;
|
||||
public static IntPtr ValueCallbacks;
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal CFDictionary (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -50,6 +50,7 @@ namespace CoreFoundation
|
|||
}
|
||||
#endif
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal CFMachPort (NativeHandle handle, bool owns)
|
||||
#else
|
||||
|
|
|
@ -58,6 +58,7 @@ namespace CoreFoundation {
|
|||
|
||||
public class CFNotificationCenter : NativeObject {
|
||||
// If this becomes public for some reason, and more than three instances are created, you should revisit the lookup code
|
||||
[Preserve (Conditional = true)]
|
||||
internal CFNotificationCenter (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -38,6 +38,7 @@ namespace CoreFoundation
|
|||
|
||||
static nint CFNumberTypeID = CFNumberGetTypeID ();
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal CFPropertyList (NativeHandle handle, bool owns)
|
||||
#else
|
||||
|
|
|
@ -56,6 +56,7 @@ namespace CoreFoundation {
|
|||
}
|
||||
#endif
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal CFReadStream (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -79,6 +79,7 @@ namespace CoreFoundation {
|
|||
}
|
||||
#endif
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal CFRunLoopSource (NativeHandle handle, bool owns)
|
||||
#else
|
||||
|
|
|
@ -33,7 +33,9 @@ using System;
|
|||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using CoreFoundation;
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
#if !NET
|
||||
|
@ -335,6 +337,7 @@ namespace CoreFoundation {
|
|||
}
|
||||
}
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
CFSocket (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -727,6 +727,7 @@ namespace CoreFoundation {
|
|||
}
|
||||
#endif
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
protected CFStream (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -8,6 +8,7 @@ using System;
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
using CoreFoundation;
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
#if !NET
|
||||
|
@ -28,6 +29,7 @@ namespace CoreFoundation {
|
|||
}
|
||||
#endif
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal CFType (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -60,6 +60,7 @@ namespace CoreFoundation {
|
|||
/* CFURLPathStyle */ nint pathStyle,
|
||||
/* Boolean */ [MarshalAs (UnmanagedType.I1)] bool isDirectory);
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal CFUrl (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -48,6 +48,7 @@ using NativeHandle = System.IntPtr;
|
|||
namespace CoreFoundation {
|
||||
|
||||
public class CFWriteStream : CFStream {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CFWriteStream (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -760,6 +760,7 @@ namespace CoreFoundation {
|
|||
public class DispatchGroup : DispatchObject
|
||||
{
|
||||
#if !COREBUILD
|
||||
[Preserve (Conditional = true)]
|
||||
private DispatchGroup (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -26,6 +26,7 @@ namespace CoreFoundation {
|
|||
[Mac (10, 10)]
|
||||
#endif
|
||||
public sealed class DispatchBlock : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal DispatchBlock (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -39,6 +39,7 @@ namespace CoreFoundation {
|
|||
|
||||
public partial class DispatchData : DispatchObject {
|
||||
#if !COREBUILD
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal DispatchData (NativeHandle handle, bool owns) : base (handle, owns)
|
||||
#else
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Collections.Generic;
|
||||
|
@ -74,6 +76,7 @@ namespace CoreFoundation {
|
|||
[DllImport ("__Internal")]
|
||||
extern static void xamarin_os_log (IntPtr logHandle, OSLogLevel level, string message);
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal OSLog (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -87,6 +87,7 @@ namespace CoreGraphics {
|
|||
}
|
||||
#endif
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal CGEvent (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -38,6 +38,7 @@ namespace CoreGraphics {
|
|||
}
|
||||
#endif
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal CGEventSource (NativeHandle handle, bool owns)
|
||||
#else
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
#if !NET
|
||||
|
@ -57,6 +59,7 @@ namespace CoreGraphics {
|
|||
}
|
||||
#endif
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal CGPDFPage (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -293,6 +293,7 @@ namespace CoreMedia {
|
|||
[Watch (6,0)]
|
||||
#endif
|
||||
public class CMAudioFormatDescription : CMFormatDescription {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CMAudioFormatDescription (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
@ -305,6 +306,7 @@ namespace CoreMedia {
|
|||
[Watch (6,0)]
|
||||
#endif
|
||||
public partial class CMVideoFormatDescription : CMFormatDescription {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CMVideoFormatDescription (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -34,6 +34,7 @@ namespace CoreMedia {
|
|||
}
|
||||
#endif
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal CMClock (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
@ -122,6 +123,7 @@ namespace CoreMedia {
|
|||
}
|
||||
#endif
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
private CMTimebase (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
@ -741,6 +743,7 @@ namespace CoreMedia {
|
|||
}
|
||||
#endif
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal CMClockOrTimebase (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -1485,6 +1485,7 @@ namespace CoreText {
|
|||
}
|
||||
|
||||
public partial class CTFont : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CTFont (NativeHandle handle, bool owns)
|
||||
: base (handle, owns, true)
|
||||
{
|
||||
|
|
|
@ -99,6 +99,7 @@ namespace CoreText {
|
|||
}
|
||||
|
||||
public class CTFontCollection : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CTFontCollection (NativeHandle handle, bool owns)
|
||||
: base (handle, owns, verify: true)
|
||||
{
|
||||
|
|
|
@ -355,6 +355,7 @@ namespace CoreText {
|
|||
}
|
||||
|
||||
public class CTFontDescriptor : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CTFontDescriptor (NativeHandle handle, bool owns)
|
||||
: base (handle, owns, true)
|
||||
{
|
||||
|
|
|
@ -112,6 +112,7 @@ namespace CoreText {
|
|||
}
|
||||
|
||||
public class CTFrame : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CTFrame (NativeHandle handle, bool owns)
|
||||
: base (handle, owns, verify: true)
|
||||
{
|
||||
|
|
|
@ -43,6 +43,7 @@ using NativeHandle = System.IntPtr;
|
|||
namespace CoreText {
|
||||
|
||||
public class CTFramesetter : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CTFramesetter (NativeHandle handle, bool owns)
|
||||
: base (handle, owns, true)
|
||||
{
|
||||
|
|
|
@ -56,6 +56,7 @@ namespace CoreText {
|
|||
#endregion
|
||||
|
||||
public class CTGlyphInfo : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CTGlyphInfo (NativeHandle handle, bool owns)
|
||||
: base (handle, owns, true)
|
||||
{
|
||||
|
|
|
@ -64,6 +64,7 @@ namespace CoreText {
|
|||
}
|
||||
|
||||
public class CTLine : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CTLine (NativeHandle handle, bool owns)
|
||||
: base (handle, owns, true)
|
||||
{
|
||||
|
|
|
@ -320,6 +320,7 @@ namespace CoreText {
|
|||
}
|
||||
|
||||
public class CTParagraphStyle : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CTParagraphStyle (NativeHandle handle, bool owns)
|
||||
: base (handle, owns, true)
|
||||
{
|
||||
|
|
|
@ -53,6 +53,7 @@ namespace CoreText {
|
|||
}
|
||||
|
||||
public class CTRun : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CTRun (NativeHandle handle, bool owns)
|
||||
: base (handle, owns, true)
|
||||
{
|
||||
|
|
|
@ -179,6 +179,7 @@ namespace CoreText {
|
|||
}
|
||||
|
||||
public class CTRunDelegate : NativeObject, IDisposable {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CTRunDelegate (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -84,6 +84,7 @@ namespace CoreText {
|
|||
#endregion
|
||||
|
||||
public class CTTextTab : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CTTextTab (NativeHandle handle, bool owns)
|
||||
: base (handle, owns, verify: true)
|
||||
{
|
||||
|
|
|
@ -110,6 +110,7 @@ namespace CoreText {
|
|||
#endregion
|
||||
|
||||
public class CTTypesetter : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CTTypesetter (NativeHandle handle, bool owns)
|
||||
: base (handle, owns, verify: true)
|
||||
{
|
||||
|
|
|
@ -31,6 +31,7 @@ namespace CoreVideo {
|
|||
[iOS (8,0), Mac (12,0), MacCatalyst (15,0)]
|
||||
#endif
|
||||
public class CVMetalTexture : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal CVMetalTexture (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -42,6 +42,7 @@ namespace CoreVideo {
|
|||
/* CFDictionaryRef __nullable */ IntPtr textureAttributes,
|
||||
/* CVMetalTextureCacheRef __nullable * __nonnull */ out IntPtr cacheOut);
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal CVMetalTextureCache (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#if MONOMAC
|
||||
|
||||
using System;
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Collections.Generic;
|
||||
|
@ -72,6 +73,7 @@ namespace Darwin {
|
|||
{
|
||||
}
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
SystemLog (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
@ -199,6 +201,7 @@ namespace Darwin {
|
|||
True = 7
|
||||
}
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal Message (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -32,6 +32,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("tvos12.0")]
|
||||
#endif
|
||||
public class NWAdvertiseDescriptor : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal NWAdvertiseDescriptor (NativeHandle handle, bool owns) : base (handle, owns)
|
||||
#else
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace Network {
|
|||
#endif
|
||||
public class NWBrowseResult : NativeObject {
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWBrowseResult (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
[DllImport (Constants.NetworkLibrary)]
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace Network {
|
|||
bool queueSet = false;
|
||||
object startLock = new Object ();
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWBrowser (NativeHandle handle, bool owns) : base (handle, owns)
|
||||
{
|
||||
SetChangesHandler (InternalChangesHandler);
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace Network {
|
|||
#endif
|
||||
public class NWBrowserDescriptor: NativeObject {
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWBrowserDescriptor (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
[DllImport (Constants.NetworkLibrary)]
|
||||
|
|
|
@ -54,6 +54,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("tvos12.0")]
|
||||
#endif
|
||||
public class NWConnection : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal NWConnection (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
#else
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("maccatalyst14.0")]
|
||||
#endif
|
||||
public class NWConnectionGroup : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
protected internal NWConnectionGroup (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
[DllImport (Constants.NetworkLibrary)]
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace Network {
|
|||
#endif
|
||||
public class NWContentContext : NativeObject {
|
||||
bool global;
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal NWContentContext (NativeHandle handle, bool owns) : base (handle, owns)
|
||||
#else
|
||||
|
|
|
@ -36,6 +36,7 @@ namespace Network {
|
|||
#endif
|
||||
public class NWDataTransferReport : NativeObject {
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWDataTransferReport (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
[DllImport (Constants.NetworkLibrary)]
|
||||
|
|
|
@ -34,6 +34,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("tvos12.0")]
|
||||
#endif
|
||||
public class NWEndpoint : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal NWEndpoint (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
#else
|
||||
|
|
|
@ -30,6 +30,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("tvos12.0")]
|
||||
#endif
|
||||
public class NWError : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal NWError (NativeHandle handle, bool owns) : base (handle, owns)
|
||||
#else
|
||||
|
|
|
@ -39,6 +39,7 @@ namespace Network {
|
|||
#endif
|
||||
public class NWEstablishmentReport : NativeObject {
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWEstablishmentReport (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
[DllImport (Constants.NetworkLibrary)]
|
||||
|
|
|
@ -41,6 +41,7 @@ namespace Network {
|
|||
#endif
|
||||
public class NWEthernetChannel : NativeObject {
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWEthernetChannel (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
[DllImport (Constants.NetworkLibrary)]
|
||||
|
|
|
@ -42,6 +42,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("macos10.15")]
|
||||
#endif
|
||||
public class NWFramer : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWFramer (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
[DllImport (Constants.NetworkLibrary)]
|
||||
|
|
|
@ -39,6 +39,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("macos10.15")]
|
||||
#endif
|
||||
public class NWFramerMessage : NWProtocolMetadata {
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWFramerMessage (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
[DllImport (Constants.NetworkLibrary)]
|
||||
|
|
|
@ -29,6 +29,7 @@ namespace Network {
|
|||
#endif
|
||||
public class NWIPMetadata : NWProtocolMetadata {
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWIPMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
public NWIPMetadata () : this (nw_ip_create_metadata (), owns: true) {}
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("tvos12.0")]
|
||||
#endif
|
||||
public class NWInterface : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal NWInterface (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
#else
|
||||
|
|
|
@ -34,6 +34,7 @@ namespace Network {
|
|||
public class NWListener : NativeObject {
|
||||
bool connectionHandlerWasSet = false;
|
||||
object connectionHandlerLock = new object ();
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal NWListener (NativeHandle handle, bool owns) : base (handle, owns)
|
||||
#else
|
||||
|
|
|
@ -25,6 +25,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("maccatalyst14.0")]
|
||||
#endif
|
||||
public class NWMulticastGroup : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWMulticastGroup (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
[DllImport (Constants.NetworkLibrary)]
|
||||
|
|
|
@ -25,6 +25,7 @@ namespace Network {
|
|||
[DllImport (Constants.NetworkLibrary)]
|
||||
static extern OS_nw_group_descriptor nw_group_descriptor_create_multiplex (OS_nw_endpoint remoteEndpoint);
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWMultiplexGroup (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
public NWMultiplexGroup (NWEndpoint endpoint)
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
using CoreFoundation;
|
||||
|
||||
|
@ -34,6 +36,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("tvos12.0")]
|
||||
#endif
|
||||
public class NWParameters : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal NWParameters (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
#else
|
||||
|
|
|
@ -31,6 +31,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("tvos12.0")]
|
||||
#endif
|
||||
public class NWPath : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal NWPath (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
#else
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("tvos12.0")]
|
||||
#endif
|
||||
public class NWPathMonitor : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal NWPathMonitor (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
#else
|
||||
|
|
|
@ -24,6 +24,7 @@ namespace Network {
|
|||
public static NWPrivacyContext Default =>
|
||||
new NWPrivacyContext (NWPrivacyContextConstants._DefaultContext, false);
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal NWPrivacyContext (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
#else
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("tvos12.0")]
|
||||
#endif
|
||||
public class NWProtocolDefinition : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal NWProtocolDefinition (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
#else
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("macos10.15")]
|
||||
#endif
|
||||
public class NWProtocolIPOptions : NWProtocolOptions {
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWProtocolIPOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
public void SetVersion (NWIPVersion version)
|
||||
|
|
|
@ -58,6 +58,7 @@ namespace Network {
|
|||
}
|
||||
#endif
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal NWProtocolMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
#else
|
||||
|
|
|
@ -34,6 +34,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("tvos12.0")]
|
||||
#endif
|
||||
public class NWProtocolOptions : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal NWProtocolOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
#else
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
using Security;
|
||||
using System.Runtime.Versioning;
|
||||
|
@ -24,6 +25,7 @@ namespace Network {
|
|||
#endif
|
||||
public class NWProtocolQuicOptions : NWProtocolOptions {
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWProtocolQuicOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
public NWProtocolQuicOptions () : this (nw_quic_create_options (), owns: true) {}
|
||||
|
|
|
@ -36,6 +36,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("tvos12.0")]
|
||||
#endif
|
||||
public class NWProtocolStack : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal NWProtocolStack (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
#else
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace Network {
|
|||
#endif
|
||||
public class NWProtocolTcpOptions : NWProtocolOptions {
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWProtocolTcpOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
public NWProtocolTcpOptions () : this (nw_tcp_create_options (), owns: true) {}
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("tvos12.0")]
|
||||
#endif
|
||||
public class NWProtocolTlsOptions : NWProtocolOptions {
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWProtocolTlsOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
public NWProtocolTlsOptions () : this (nw_tls_create_options (), owns: true) {}
|
||||
|
|
|
@ -29,6 +29,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("tvos12.0")]
|
||||
#endif
|
||||
public class NWProtocolUdpOptions : NWProtocolOptions {
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWProtocolUdpOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
public NWProtocolUdpOptions () : this (nw_udp_create_options (), owns: true) {}
|
||||
|
|
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
using Security;
|
||||
|
||||
|
@ -23,6 +24,7 @@ namespace Network {
|
|||
#endif
|
||||
public class NWQuicMetadata : NWProtocolMetadata {
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal NWQuicMetadata (NativeHandle handle, bool owns) : base (handle, owns) { }
|
||||
#else
|
||||
|
|
|
@ -25,6 +25,7 @@ namespace Network {
|
|||
#endif
|
||||
public class NWResolutionReport : NativeObject {
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWResolutionReport (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
[DllImport (Constants.NetworkLibrary)]
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
using CoreFoundation;
|
||||
using System.Runtime.Versioning;
|
||||
|
@ -22,6 +24,7 @@ namespace Network {
|
|||
#endif
|
||||
public class NWResolverConfig : NativeObject {
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
#if NET
|
||||
internal NWResolverConfig (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
#else
|
||||
|
|
|
@ -29,6 +29,7 @@ namespace Network {
|
|||
#endif
|
||||
public class NWTcpMetadata : NWProtocolMetadata {
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWTcpMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
public uint AvailableReceiveBuffer => nw_tcp_get_available_receive_buffer (GetCheckedHandle ());
|
||||
|
|
|
@ -30,6 +30,7 @@ namespace Network {
|
|||
#endif
|
||||
public class NWTlsMetadata : NWProtocolMetadata {
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWTlsMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
public SecProtocolMetadata SecProtocolMetadata
|
||||
|
|
|
@ -37,6 +37,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("macos10.15")]
|
||||
#endif
|
||||
public class NWTxtRecord : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWTxtRecord (NativeHandle handle, bool owns) : base (handle, owns) { }
|
||||
|
||||
[DllImport (Constants.NetworkLibrary)]
|
||||
|
|
|
@ -30,6 +30,7 @@ namespace Network {
|
|||
#endif
|
||||
public class NWUdpMetadata : NWProtocolMetadata {
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWUdpMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
public NWUdpMetadata () : this (nw_udp_create_metadata (), owns: true) {}
|
||||
|
|
|
@ -36,6 +36,7 @@ namespace Network {
|
|||
#endif
|
||||
public class NWWebSocketMetadata : NWProtocolMetadata {
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWWebSocketMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
[DllImport (Constants.NetworkLibrary)]
|
||||
|
|
|
@ -38,6 +38,7 @@ namespace Network {
|
|||
bool skipHandShake = false;
|
||||
nuint maximumMessageSize;
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWWebSocketOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
[DllImport (Constants.NetworkLibrary)]
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace Network {
|
|||
[SupportedOSPlatform ("macos10.15")]
|
||||
#endif
|
||||
public class NWWebSocketRequest : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWWebSocketRequest (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
[DllImport (Constants.NetworkLibrary)]
|
||||
|
|
|
@ -34,6 +34,7 @@ namespace Network {
|
|||
#endif
|
||||
public class NWWebSocketResponse : NativeObject {
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal NWWebSocketResponse (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
[DllImport (Constants.NetworkLibrary, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
|
||||
|
|
|
@ -26,6 +26,7 @@ using NativeHandle = System.IntPtr;
|
|||
|
||||
namespace PrintCore {
|
||||
public class PMPrintCoreBase : NativeObject {
|
||||
[Preserve (Conditional = true)]
|
||||
internal PMPrintCoreBase (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
@ -56,6 +57,7 @@ namespace PrintCore {
|
|||
[DllImport (Constants.PrintCoreLibrary)]
|
||||
extern static PMStatusCode PMCreateSession (out IntPtr session);
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal PMPrintSession (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
static IntPtr Create ()
|
||||
|
@ -160,6 +162,7 @@ namespace PrintCore {
|
|||
[DllImport (Constants.PrintCoreLibrary)]
|
||||
extern static PMStatusCode PMCreatePrintSettings (out IntPtr session);
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal PMPrintSettings (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
@ -319,6 +322,7 @@ namespace PrintCore {
|
|||
[DllImport (Constants.PrintCoreLibrary)]
|
||||
extern static PMStatusCode PMCreatePageFormatWithPMPaper (out IntPtr handle, IntPtr paper);
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal PMPageFormat (NativeHandle handle, bool owns): base (handle, owns) {}
|
||||
|
||||
static IntPtr Create (PMPaper? paper = null)
|
||||
|
@ -398,6 +402,7 @@ namespace PrintCore {
|
|||
}
|
||||
|
||||
public class PMPaper : PMPrintCoreBase {
|
||||
[Preserve (Conditional = true)]
|
||||
internal PMPaper (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
[DllImport (Constants.PrintCoreLibrary)]
|
||||
extern static PMStatusCode PMPaperGetID (IntPtr handle, out IntPtr str);
|
||||
|
@ -465,6 +470,7 @@ namespace PrintCore {
|
|||
[DllImport (Constants.PrintCoreLibrary)]
|
||||
extern static IntPtr PMPrinterCreateFromPrinterID (IntPtr id);
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal PMPrinter (NativeHandle handle, bool owns) : base (handle, owns) {}
|
||||
|
||||
static IntPtr Create ()
|
||||
|
|
|
@ -47,6 +47,7 @@ namespace SearchKit
|
|||
|
||||
public class SKSearch : NativeObject
|
||||
{
|
||||
[Preserve (Conditional = true)]
|
||||
internal SKSearch (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
@ -134,6 +135,7 @@ namespace SearchKit
|
|||
{
|
||||
}
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal SKDocument (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
@ -197,6 +199,7 @@ namespace SearchKit
|
|||
[DllImport (Constants.SearchKitLibrary)]
|
||||
extern static void SKIndexClose (IntPtr handle);
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
SKIndex (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
@ -490,6 +493,7 @@ namespace SearchKit
|
|||
|
||||
public class SKSummary : NativeObject
|
||||
{
|
||||
[Preserve (Conditional = true)]
|
||||
internal SKSummary (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -154,6 +154,7 @@ namespace Security {
|
|||
[DllImport (Constants.SecurityLibrary)]
|
||||
extern static int /* OSStatus = int */ AuthorizationFree (IntPtr handle, AuthorizationFlags flags);
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
internal Authorization (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
|
@ -106,6 +106,7 @@ namespace Security {
|
|||
#endif
|
||||
public partial class SecAccessControl : NativeObject {
|
||||
#if !COREBUILD
|
||||
[Preserve (Conditional = true)]
|
||||
internal SecAccessControl (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче