Exemplo n.º 1
0
        public static CFDictionary FromObjectsAndKeys(CFObject[] objects, CFObject[] keys)
        {
            if (objects == null)
                throw new ArgumentNullException ("objects");

            if (keys == null)
                throw new ArgumentNullException ("keys");

            if (objects.Length != keys.Length)
                throw new ArgumentException ("The length of both arrays must be the same");

            IntPtr [] k = new IntPtr [keys.Length];
            IntPtr [] v = new IntPtr [keys.Length];

            for (int i = 0; i < k.Length; i++) {
                k [i] = keys [i].Handle;
                v [i] = objects [i].Handle;
            }

            return new CFDictionary (CFDictionaryCreate (IntPtr.Zero, k, v, k.Length, KeyCallbacks, ValueCallbacks), true);
        }
Exemplo n.º 2
0
 public static CFDictionary FromObjectAndKey(CFObject obj, CFObject key)
 {
     return(new CFDictionary(CFDictionaryCreate(IntPtr.Zero, new IntPtr[] { key.Handle }, new IntPtr [] { obj.Handle }, 1, KeyCallbacks, ValueCallbacks), true));
 }
Exemplo n.º 3
0
 public static CFDictionary FromObjectAndKey(CFObject obj, CFObject key)
 {
     return new CFDictionary (CFDictionaryCreate (IntPtr.Zero, new IntPtr[] { key.Handle }, new IntPtr [] { obj.Handle }, 1, KeyCallbacks, ValueCallbacks), true);
 }