Граф коммитов

11983 Коммитов

Автор SHA1 Сообщение Дата
Mauro Agnoletti a88ca0d29d
Updated Xamarin.Messaging version (#13145)
* Updated Xamarin.Messaging version

* Adapt BuildAgent to new Messaging changes
2021-10-28 17:00:14 +02:00
Rolf Bjarne Kvinge 02431b9fc8
[.NET] Move the nfloat type to the ObjCRuntime namespace for .NET. (#13092)
Also move the NMath type from the System namespace to the ObjCRuntime namespace.

Ref: https://github.com/xamarin/xamarin-macios/issues/13087
2021-10-28 11:06:31 +02:00
Rolf Bjarne Kvinge 8f1e650bea
[tests] Allow for F# project files (*.fsproj) in generic make logic. (#13137) 2021-10-28 11:04:29 +02:00
Rolf Bjarne Kvinge 15232eb29a
[CGImage] Subclass NativeObject + numerous other code updates (#13132)
* [CGImage] Subclass NativeObject + numerous other code updates

* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Use 'nameof (parameter)' instead of string constants.
* Remove the (IntPtr) constructor for XAMCORE_4_0.

* [CoreFoundation] Adjust NativeObject's logic to optionally verify the pointer to actually work.

* [CGImage] Don't verify the handle passed to the constructor until .NET.
2021-10-28 08:22:08 +02:00
Rolf Bjarne Kvinge 7597f91452
[CGLayer] Subclass NativeObject + numerous other code updates (#13141)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Remove the internal (IntPtr) constructor.
2021-10-28 08:15:34 +02:00
Rolf Bjarne Kvinge 44cf7ae388
[CGPath] Subclass NativeObject + numerous other code updates (#13142)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use 'nameof (parameter)' instead of string constants.
* Remove the (IntPtr) constructor for XAMCORE_4_0.
* Fix constructor chain invocation for the (IntPtr, bool) constructor to
  actually pass on the 'owns' parameter.
2021-10-28 08:15:27 +02:00
Rolf Bjarne Kvinge 878da5c0c4
[generator] Call the (IntPtr, bool) constructor for INativeObjects. (#13144)
This is required, because the (IntPtr) constructor will eventually be removed for all types.
2021-10-28 08:15:15 +02:00
Manuel de la Pena c2e2ac8b40
[AVFoundation] Make the notification change for xamcore 4 (#13134)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-10-27 15:06:17 -04:00
Manuel de la Pena 40db84a71e
[WebKit] Add methods removed by Apple. (#13133)
Apple removed methods without deprecating and did not add them back
after a rdar was reported. We can implement those methofs using the new
ones.
2021-10-27 15:04:44 -04:00
Rolf Bjarne Kvinge f1d20dc2bc
[CGEvent] Subclass NativeObject + numerous other code updates (#13122)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Use 'nameof (parameter)' instead of string constants.
* Remove the (IntPtr) constructor for XAMCORE_4_0.
2021-10-27 10:24:56 +02:00
Rolf Bjarne Kvinge 978ef11f1d
[CGEventSource] Subclass NativeObject + numerous other code updates (#13125)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Remove the (IntPtr) constructor for XAMCORE_4_0.
* Make the (IntPtr, bool) constructor internal for XAMCORE_4_0.
2021-10-27 10:24:45 +02:00
Rolf Bjarne Kvinge a28fc44056
[CF[Read|Write|HTTP]Stream] Subclass NativeObject + numerous other code updates (#13127)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Use 'nameof (parameter)' instead of string constants.
* Call 'GetCheckedHandle ()' (which will throw an ObjectDisposedException if
  Handle == IntPtr.Zero) instead of manually checking for IntPtr.Zero and
  throwing ObjectDisposedException.
* Use Array.Empty<T> instead of creating an empty array manually.
* Remove the (IntPtr) constructor for XAMCORE_4_0.
* Add an internal (IntPtr, bool) constructor.
2021-10-27 10:20:57 +02:00
Rolf Bjarne Kvinge cf8008cbc0
[CMSync] Subclass NativeObject + numerous other code updates (#13131)
* Subclass NativeObject to reuse object lifetime code.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use 'nameof (parameter)' instead of string constants.
* Remove the (IntPtr) constructor for XAMCORE_4_0.
2021-10-27 10:18:48 +02:00
Rolf Bjarne Kvinge 8d6c97ef00
[CMMemoryPool] Subclass NativeObject + a few other code updates (#13129)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
2021-10-27 10:18:31 +02:00
Rolf Bjarne Kvinge becfa7d992
[CTFont] Subclass NativeObject + numerous other code updates (#13102)
* [CTFont] Subclass NativeObject + numerous other code updates

* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use CFString.CreateNative/ReleaseNative instead of other means to create
  native strings (the fastest and least memory hungry option).
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Use 'nameof (parameter)' instead of string constants.
* Use the 'Runtime.GetNSObject<T> (IntPtr, bool)' overload to specify handle
  ownership, to avoid having to call NSObject.DangerousRelease manually later.
* Use Array.Empty<T> instead of creating an empty array manually.
* Add an NSArray.ArrayFromHandle overload that releases the handle if requested (and use it).

* Remove more code.
2021-10-27 10:17:05 +02:00
Rolf Bjarne Kvinge bbb5838113
[CGGradient] Subclass NativeObject + numerous other code updates (#13130)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Use 'nameof (parameter)' instead of string constants.
* Call 'GetCheckedHandle ()' (which will throw an ObjectDisposedException if
  Handle == IntPtr.Zero) instead of manually checking for IntPtr.Zero and
  throwing ObjectDisposedException.
2021-10-27 10:11:13 +02:00
Mike Bond 606908acd6
[CI] M1 - Mac Big Sur (11.5): Agent pool update (#13095) 2021-10-26 14:01:15 -07:00
Alex Soto 7021b3890d
Bump macios to Xcode 13.1 SDKs (#13123) 2021-10-26 13:58:37 -04:00
Rolf Bjarne Kvinge bf51c2dcf9
[CGDataConsumer] Subclass NativeObject + numerous other code updates (#13120)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use CFString.CreateNative/ReleaseNative instead of other means to create
  native strings (the fastest and least memory hungry option).
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Use 'nameof (parameter)' instead of string constants.
2021-10-26 17:06:35 +02:00
Rolf Bjarne Kvinge 3213646bdc
[CGContext] Subclass NativeObject + numerous other code updates (#13119)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Use 'nameof (parameter)' instead of string constants.
* Call 'GetCheckedHandle ()' (which will throw an ObjectDisposedException if
  Handle == IntPtr.Zero) instead of manually checking for IntPtr.Zero and
  throwing ObjectDisposedException.
* Remove the (IntPtr) constructor for XAMCORE_4_0.
2021-10-26 16:15:15 +02:00
Rolf Bjarne Kvinge 35e1324024
[CGShading] Subclass NativeObject + numerous other code updates (#13117)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use 'nameof (parameter)' instead of string constants.
* Call 'GetCheckedHandle ()' (which will throw an ObjectDisposedException if
  Handle == IntPtr.Zero) instead of manually checking for IntPtr.Zero and
  throwing ObjectDisposedException.
* Remove the (IntPtr) constructor for XAMCORE_4_0.
2021-10-26 16:11:17 +02:00
Rolf Bjarne Kvinge 7d597f53b5
[CMSampleBuffer] Subclass NativeObject + numerous other code updates. Fixes #12833. (#13115)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use CFString.CreateNative/ReleaseNative instead of other means to create
  native strings (the fastest and least memory hungry option).
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Use 'nameof (parameter)' instead of string constants.
* Call 'GetCheckedHandle ()' (which will throw an ObjectDisposedException if
  Handle == IntPtr.Zero) instead of manually checking for IntPtr.Zero and
  throwing ObjectDisposedException.
* Use Array.Empty<T> instead of creating an empty array manually.
* Remove the internal (IntPtr) constructor and update callsites to call the
  (IntPtr, bool) constructor.

Fixes https://github.com/xamarin/xamarin-macios/issues/12833.
2021-10-26 16:01:22 +02:00
Rolf Bjarne Kvinge c65bdc767e
[CFHost] Subclass NativeObject + numerous other code updates (#13111)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
2021-10-26 08:29:24 +02:00
Rolf Bjarne Kvinge fad9779840
[runtime] Pass value callbacks to free values when creating the 'gchandle_hash' dictionary. (#13109)
This way the values are actually freed.
2021-10-26 08:28:03 +02:00
Rolf Bjarne Kvinge 00ea033536
[CFHTTPMessage] Indirectly subclass NativeObject + numerous other code updates (#13110)
* The base class CFType now subclasses NativeObject, so we can remove a lot of unnecessary code.
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use CFString.CreateNative/ReleaseNative instead of other means to create
  native strings (the fastest and least memory hungry option).
* Use 'nameof (parameter)' instead of string constants.
* Remove the internal (IntPtr) constructor.
* Adjust the string<->CFString conversion operators to allow for null input
  (and thus null output), and annotate the operators accordingly when
  possible.
2021-10-26 08:27:38 +02:00
Rolf Bjarne Kvinge cc5a1ea94e
[CFHTTPAuthentication] Indirectly subclass NativeObject + numerous other code updates (#13107)
* The base class CFType now subclasses NativeObject, so we can remove a lot of unnecessary code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use 'nameof (parameter)' instead of string constants.
* Remove the internal (IntPtr) constructor.
2021-10-26 08:27:23 +02:00
Rolf Bjarne Kvinge 90228391d4
[Policy] Subclass NativeObject + numerous other code updates (#13108)
* Subclass NativeObject to reuse object lifetime code.
* This needed another constructor overload in NativeObject that validates that
  the handle is valid, since the Policy class verifies that.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use CFString.CreateNative/ReleaseNative instead of other means to create
  native strings (the fastest and least memory hungry option).
* Remove the (IntPtr) constructor for XAMCORE_4_0.
2021-10-26 08:22:56 +02:00
Rolf Bjarne Kvinge 94a7e815ce
[Trust] Subclass NativeObject + numerous other code updates (#13104)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Use 'nameof (parameter)' instead of string constants.
* Call 'GetCheckedHandle ()' (which will throw an ObjectDisposedException if
  Handle == IntPtr.Zero) instead of manually checking for IntPtr.Zero and
  throwing ObjectDisposedException.
* Remove the (IntPtr) constructor for XAMCORE_4_0.
2021-10-26 08:21:30 +02:00
Rolf Bjarne Kvinge 79fc7433c2
[CGColorSpace] Subclass NativeObject + numerous other code updates (#13089)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Use 'nameof (parameter)' instead of string constants.
* Call 'GetCheckedHandle ()' (which will throw an ObjectDisposedException if
  Handle == IntPtr.Zero) instead of manually checking for IntPtr.Zero and
  throwing ObjectDisposedException.
* Add a FromHandle method that creates a CGColorSpace from an IntPtr, checking
  for IntPtr.Zero first, to deduplicate a lot of code.
2021-10-26 08:19:52 +02:00
Rolf Bjarne Kvinge b70e6f4674
Submodule MonoTouch.Dialog. (#13058)
* Submodule MonoTouch.Dialog.

Submodule MonoTouch.Dialog, so that we can easily build it using .NET. This
submodule will become redundant when/if we publish a .NET version of
MonoTouch.Dialog, but until that happens we need it at least for our own test
suites.

This also means we have to copy our NuGet.config and global.json files to the
MonoTouch.Dialog project directory so that we point msbuild to use our local
build.

New commits in spouliot/Touch.Unit:

* spouliot/Touch.Unit@cbda703 [Touch.Client] Use MonoTouch.Dialog from a submodule. (#109)

Diff: 3345db2f4e..cbda703583

* Use relative path for submodule.

And fix indentation and set the branch name.

* Don't use 'RootTestsDirectory' when it might not be defined yet.

* [tests] Our test projects don't need to reference MonoTouch.Dialog directly.

The projects get the MonoTouch.Dialog reference indirectly through the
Touch.Client project reference.

* [tests] Only validate unique errors in the .NET unit tests.

* [tests] No need to reference System.Json anymore, that's handled directly in the MonoTouch.Dialog project.

* [tests] Reference nunit.framework.targets so we get a workaround for an NUnit issue everywhere.

* [msbuild] Only try to create a package if we're able to create an app bundle.

This fixes an issue where a library project would try (and fail) to create a
package when 'CreatePackage=true' (which could be set for the executable
project, but inherited by the library project since the executable project
depends on it).

* [tests] Adjust PackTest.BindingXcFrameworksProject to not set the AssemblyName property.

MSBuild ends up being very confused when the project we're trying to build
depends on other projects, because AssemblyName is set for all the projects
being build, and MSBuild complains about ambiguous projects:

> error: Ambiguous project name 'bindings-xcframework-test'
2021-10-26 08:18:34 +02:00
Manuel de la Pena aca9bb0046
[WebKit] Add support for Xcode 13.1 rc. (#13052)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-10-25 20:13:00 -04:00
Rolf Bjarne Kvinge 44f88fcd92
[SslContext] Subclass NativeObject + numerous other code updates (#13105)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Use 'nameof (parameter)' instead of string constants.
2021-10-25 21:14:14 +02:00
Rolf Bjarne Kvinge 959c65d06c
[CGFunction] Subclass NativeObject + numerous other code updates (#13090)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use 'nameof (parameter)' instead of string constants.
* Call 'GetCheckedHandle ()' (which will throw an ObjectDisposedException if
  Handle == IntPtr.Zero) instead of manually checking for IntPtr.Zero and
  throwing ObjectDisposedException.
* Remove the (IntPtr) constructor for XAMCORE_4_0.
2021-10-25 19:11:34 +02:00
Chris Hamons ab5c0c6b56
[net6] Fix ILStrip'ed apps to actually work again (#13098)
* [net6] Fix ILStrip'ed apps to actually work again

- In a late minute change to the ILStrip PR (https://github.com/xamarin/xamarin-macios/pull/12563) a change to support XVS support broke execution of Apps that were stripped
- Applications were broken because none of the stripped assemblies were actually copied into the bundle
- However, the tests still passed, because all assemblies that were there had no IL (zero assemblies total)

Now why did this happen?
- The stripped assemblies were changed to return via an msbuild Output Element
- Output Element can return an Property or ItemGroup, depending if you use the PropertyName or ItemName attributes
- Unfortunately I used PropertyName, when I expected an ItemGroup. So I silently had a property created instead.
- Thus zero items were added to the list of files to copy into the bundle
- Which was undetected as the test did not confirm files were copied in, and manual tests were not run so late into the PR (3 weeks after PR was opened)

How was it fixed?
- Correctly using ItemName on Output created a valid item group to reference
- However, that still failed with an absurdly confusing error:

 PATH/Microsoft.NET.Publish.targets(277,5): error MSB3024: Could not copy the file FILE to the destination file PATH, because the destination is a folder instead of a file. To copy the source file into a folder, consider using the DestinationFolder parameter instead of DestinationFiles.

- After a splunking through netcore targets, I found the metadata on these assemblies references really matters. Without it, they are not processed correctly at all.
- Thus, I updated ILStripBase to clone the existing metadata when changing the original assembly reference to the stripped path
- Finally, I corrected the test to assert that required files are copied in. I also manually ran our device test.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-10-25 11:31:42 -05:00
Rachel Kang 5d09fd774e
Merge pull request #13080 from rachelkang/cat_corewlan
[CoreWLAN] Updates for Catalyst
2021-10-25 10:44:47 -04:00
Rachel Kang 8ab022e8f0
Merge pull request #13097 from rachelkang/cat_uikit
[UIKit] Updates for Catalyst
2021-10-25 10:44:20 -04:00
Rolf Bjarne Kvinge dbe31e91df
[CFType] Subclass NativeObject + a few other code updates (#13086)
* Subclass NativeObject to reuse object lifetime code. This isn't for CFType
  itself, but all its subclasses.
* Add a public default constructor to maintain compat, but remove it for XAMCORE_4_0.
* Add an internal (IntPtr, bool) constructor to follow the NativeObject pattern.
* Enable nullability and fix code accordingly.
* Use CFString.CreateNative/ReleaseNative instead of other means to create
  native strings (the fastest and least memory hungry option).
* Use 'nameof (parameter)' instead of string constants.
2021-10-25 15:19:00 +02:00
Rolf Bjarne Kvinge 0ede53d01b
[ABRecord] Subclass NativeObject + numerous other code updates (#13085)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use CFString.CreateNative/ReleaseNative instead of other means to create
  native strings (the fastest and least memory hungry option).
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Use 'nameof (parameter)' instead of string constants.
2021-10-25 10:57:24 +02:00
Rolf Bjarne Kvinge 22b8c38d36
[UIFontFeature] Enable nullability + a few other code updates (#13088)
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
2021-10-25 10:56:19 +02:00
Rolf Bjarne Kvinge c3574a53a3
[generator] Use '[U]IntPtr' in P/Invoke signatures instead of 'n[u]int'. (#13043)
* [generator] Use '[U]IntPtr' in the P/Invoke signature for native enums.

* Use '[U]IntPtr' as the parameter type in the P/Invoke signature for native enum
  parameters.
* Use '[U]IntPtr' in the P/Invoke method name for native enum parameters.
* Add an explicit conversion from UIntPtr to nuint (like we already have from IntPtr
  to nint).

This makes the code identical between .NET and legacy Xamarin when using C# n[u]ints,
because those are really [U]IntPtrs.

* Use IntPtr/UIntPtr for all nint/nuint types in P/Invokes, not only native enums.

* Add a few more casts

Fixes these generator tests:

* GeneratorTests.BGenTests.FieldEnumTests
* GeneratorTests.BGenTests.NativeEnum

* [registrar] Handle UIntPtr like we do IntPtr.

Fixes this error in numerous tests:

    error MT4169: Failed to generate a P/Invoke wrapper for objc_msgSend(System.IntPtr,System.IntPtr): The registrar cannot build a signature for type `System.Void' in method `ObjCRuntime.Messaging.objc_msgSend`.

* [NativeTypes] Make IntPtr and UIntPtr behave the same.

This fixes an issue where the linked output for a 32-bit mscorlib.dll and a
64-bit mscorlib.dll would be different, because different explicit operators
for UIntPtr would be kept.

The fix works because the conversion operators for nuint will not use
UIntPtr's explicit conversion operators anymore, it will just operate on plain
memory instead.
2021-10-25 10:56:02 +02:00
Rolf Bjarne Kvinge 2ff5743bf1
[dotnet] Bump to preview 11. (#13082) 2021-10-25 10:32:21 +02:00
Rachel Kang e8c066b123
[UIKit] Updates for Catalyst 2021-10-22 17:28:32 -04:00
TJ Lambert 560d777b92
[ApiDiffs] Applying the New Dotnet ApiDiffs to Github (#13027) 2021-10-22 10:25:33 -05:00
Rachel Kang 3b1df5b27f
Merge pull request #13076 from rachelkang/cat_printcore
[PrintCore] Updates for Catalyst
2021-10-22 11:14:20 -04:00
Rachel Kang 410237ff14
Merge pull request #13056 from rachelkang/xcode13.0-intentsui-b1-b4
[IntentsUI] Update bindings for Xcode13.0 betas 1, 4
2021-10-22 11:02:05 -04:00
Rolf Bjarne Kvinge 91e3537085
[ABPerson] Enable nullability + numerous other code updates (#13079)
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use CFString.CreateNative/ReleaseNative instead of other means to create
  native strings (the fastest and least memory hungry option).
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Use 'nameof (parameter)' instead of string constants.
2021-10-22 09:24:25 +02:00
Rolf Bjarne Kvinge 1caaf4bc89
[CFPropertyList] Subclass NativeObject + numerous other code updates (#13077)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Remove the (IntPtr) constructor for XAMCORE_4_0.
* Make the (IntPtr, bool) constructor internal for XAMCORE_4_0.
2021-10-22 09:23:05 +02:00
Rolf Bjarne Kvinge aa94452f27
[CFMessagePort] Subclass NativeObject + numerous other code updates (#13075)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use CFString.CreateNative/ReleaseNative instead of other means to create
  native strings (the fastest and least memory hungry option).
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Use 'nameof (parameter)' instead of string constants.
* Call 'GetCheckedHandle ()' (which will throw an ObjectDisposedException if
  Handle == IntPtr.Zero) instead of manually checking for IntPtr.Zero and
  throwing ObjectDisposedException.
* Remove the (IntPtr) constructor..
2021-10-22 09:22:56 +02:00
Rolf Bjarne Kvinge 96139baa0b
[CMBufferQueue] Subclass NativeObject + numerous other code updates (#13074)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use 'nameof (parameter)' instead of string constants.
2021-10-22 09:22:44 +02:00
Rolf Bjarne Kvinge eb6c2aeb95
[CFNotificationCenter] Subclass NativeObject + numerous other code updates (#13073)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use CFString.CreateNative/ReleaseNative instead of other means to create
  native strings (the fastest and least memory hungry option).
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Use 'nameof (parameter)' instead of string constants.
* Remove the (IntPtr) constructor.
2021-10-22 09:22:31 +02:00