/// <summary>
        /// Creates a new <see cref="PlistDictIterHandle"/> from a <see cref="IntPtr"/>.
        /// </summary>
        /// <param name="unsafeHandle">
        /// The underlying <see cref="IntPtr"/>
        /// </param>
        /// <param name="ownsHandle">
        /// <see langword="true"/> to reliably release the handle during the finalization phase; <see langword="false"/> to prevent reliable release (not recommended).
        /// </param>
        /// <returns>
        /// </returns>
        public static PlistDictIterHandle DangerousCreate(System.IntPtr unsafeHandle, bool ownsHandle)
        {
            PlistDictIterHandle safeHandle = new PlistDictIterHandle(ownsHandle);

            safeHandle.SetHandle(unsafeHandle);
            return(safeHandle);
        }
Exemple #2
0
 public static void plist_dict_next_item(PlistHandle node, PlistDictIterHandle iter, out string key, out PlistHandle val)
 {
     System.Runtime.InteropServices.ICustomMarshaler keyMarshaler = NativeStringMarshaler.GetInstance(null);
     System.IntPtr keyNative = System.IntPtr.Zero;
     PlistNativeMethods.plist_dict_next_item(node, iter, out keyNative, out val);
     key = ((string)keyMarshaler.MarshalNativeToManaged(keyNative));
     keyMarshaler.CleanUpNativeData(keyNative);
 }
Exemple #3
0
 /// <summary>
 /// Increment iterator of a #PLIST_DICT node.
 /// </summary>
 /// <param name="node">
 /// The node of type #PLIST_DICT
 /// </param>
 /// <param name="iter">
 /// Iterator of the dictionary
 /// </param>
 /// <param name="key">
 /// Location to store the key, or NULL. The caller is responsible
 /// for freeing the the returned string.
 /// </param>
 /// <param name="val">
 /// Location to store the value, or NULL. The caller must *not*
 /// free the returned value. Will be set to NULL when no more
 /// key/value pairs are left to iterate.
 /// </param>
 public virtual void plist_dict_next_item(PlistHandle node, PlistDictIterHandle iter, out string key, out PlistHandle val)
 {
     PlistNativeMethods.plist_dict_next_item(node, iter, out key, out val);
     val.Api = this.Parent;
 }
Exemple #4
0
 /// <summary>
 /// Create an iterator of a #PLIST_DICT node.
 /// The allocated iterator should be freed with the standard free function.
 /// </summary>
 /// <param name="node">
 /// The node of type #PLIST_DICT.
 /// </param>
 /// <param name="iter">
 /// Location to store the iterator for the dictionary.
 /// </param>
 public virtual void plist_dict_new_iter(PlistHandle node, out PlistDictIterHandle iter)
 {
     PlistNativeMethods.plist_dict_new_iter(node, out iter);
     iter.Api = this.Parent;
 }
 public static extern void plist_dict_next_item(PlistHandle node, PlistDictIterHandle iter, out System.IntPtr key, out PlistHandle val);
 public static extern void plist_dict_new_iter(PlistHandle node, out PlistDictIterHandle iter);
Exemple #7
0
 public static PlistDictIterHandle DangerousCreate(System.IntPtr unsafeHandle)
 {
     return(PlistDictIterHandle.DangerousCreate(unsafeHandle, true));
 }
Exemple #8
0
 public object MarshalNativeToManaged(System.IntPtr nativeData)
 {
     return(PlistDictIterHandle.DangerousCreate(nativeData, false));
 }