示例#1
0
        public TKey[] KeysForObject(TValue obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException(nameof(obj));
            }

            using (var pool = new NSAutoreleasePool())
                return(NSArray.ArrayFromHandle <TKey> (_AllKeysForObject(obj.Handle)));
        }
        protected T[]? GetArray <T> (NSString key) where T : NSObject
        {
            if (key is null)
            {
                throw new ArgumentNullException(nameof(key));
            }

            var value = CFDictionary.GetValue(Dictionary.Handle, key.Handle);

            return(NSArray.ArrayFromHandle <T> (value));
        }
示例#3
0
        protected T[] GetArray <T> (NSString key) where T : NSObject
        {
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }

            var value = CFDictionary.GetValue(Dictionary.Handle, key.Handle);

            if (value == IntPtr.Zero)
            {
                return(null);
            }

            return(NSArray.ArrayFromHandle <T> (value));
        }
示例#4
0
        public TValue[] ObjectsForKeys(TKey[] keys, TValue marker)
        {
            if (keys == null)
            {
                throw new ArgumentNullException(nameof(keys));
            }

            if (marker == null)
            {
                throw new ArgumentNullException(nameof(marker));
            }

            if (keys.Length == 0)
            {
                return new TValue [] {}
            }
            ;

            return(NSArray.ArrayFromHandle <TValue> (_ObjectsForKeys(NSArray.From <TKey> (keys).Handle, marker.Handle)));
        }
示例#5
0
        public T [] ToArray <T> () where T : class, INativeObject
        {
            IntPtr nsarr = _AllObjects();

            return(NSArray.ArrayFromHandle <T> (nsarr));
        }