Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 0 additions & 132 deletions docs/api/Foundation/DictionaryContainer.xml

This file was deleted.

28 changes: 28 additions & 0 deletions src/CoreFoundation/CFDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#nullable enable

using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Foundation;
using ObjCRuntime;
Expand Down Expand Up @@ -97,6 +98,20 @@ public static IntPtr GetValue (IntPtr theDict, IntPtr key)
return CFDictionaryGetValue (theDict, key);
}

[DllImport (Constants.CoreFoundationLibrary)]
unsafe extern static byte /* Boolean */ CFDictionaryGetValueIfPresent (IntPtr /* CFDictionaryRef */ theDict, IntPtr /* const void * */ key, IntPtr* /* const void * * */ value);

/// <summary>Try to get the stored value for the specified <paramref name="key" />.</summary>
/// <param name="dictionary">The dictionary whose value to get.</param>
/// <param name="key">The key of the value to find.</param>
/// <param name="value">Upon return, the value that was found, or <see cref="IntPtr.Zero" /> if the dictionary doesn't contain a value for the specified <paramref name="key" />.</param>
/// <returns><see langword="true" /> if the dictionary contains the specified <paramref name="key" />, <see langword="false" /> otherwise.</returns>
public unsafe static bool TryGetValue (IntPtr dictionary, IntPtr key, out IntPtr value)
{
value = default;
return CFDictionaryGetValueIfPresent (dictionary, key, (IntPtr*) Unsafe.AsPointer<IntPtr> (ref value)) != 0;
}

[DllImport (Constants.CoreFoundationLibrary)]
extern static nint CFDictionaryGetCount (IntPtr theDict);
public nint Count {
Expand Down Expand Up @@ -220,5 +235,18 @@ public static void SetValue (IntPtr theDict, IntPtr key, bool value)
{
SetValue (theDict, key, value ? CFBoolean.TrueHandle : CFBoolean.FalseHandle);
}

internal static void SetValue (IntPtr theDict, INativeObject? key, INativeObject? value)
{
SetValue (theDict, key.GetHandle (), value.GetHandle ());
GC.KeepAlive (key);
GC.KeepAlive (value);
}

internal static void SetValue (IntPtr theDict, INativeObject? key, IntPtr value)
{
SetValue (theDict, key.GetHandle (), value);
GC.KeepAlive (key);
}
}
}
10 changes: 10 additions & 0 deletions src/CoreVideo/CVPixelFormatDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,16 @@ public CVFillExtendedPixelsCallBackDataStruct? FillExtendedPixelsCallbackStruct
FillExtendedPixelsCallback = data;
}
}

#if !XAMCORE_5_0
[Obsolete ("Use 'ComponentRangeValue' instead, the property type is incorrect for this property.")]
[EditorBrowsable (EditorBrowsableState.Never)]
public CVPixelFormatComponentRange? ComponentRange {
get => null;
set { }
}
#endif // !XAMCORE_5_0

#endif // !COREBUILD
}
}
Loading
Loading