Exemplo n.º 1
0
        public static NSIndexSet FromArray(nuint[] items)
        {
            if (items == null)
            {
                return(new NSIndexSet());
            }

            var indexSet = new NSMutableIndexSet();

            foreach (var index in items)
            {
                indexSet.Add(index);
            }
            return(indexSet);
        }
Exemplo n.º 2
0
        public static NSIndexSet FromArray(int[] items)
        {
            if (items == null)
            {
                return(new NSIndexSet());
            }

            var indexSet = new NSMutableIndexSet();

            foreach (var index in items)
            {
                if (index < 0)
                {
                    throw new ArgumentException("One of the items values is negative");
                }
                indexSet.Add((nuint)(uint)index);
            }
            return(indexSet);
        }