Ejemplo n.º 1
0
        public static Array ListToArray(ListBase list, System.Type type)
        {
            Array result = Array.CreateInstance(type, list.Count);

            if (list.Count > 0)
            {
                list.CopyTo(result, 0);
            }

            if (type.IsSubclassOf(typeof(GLib.Opaque)))
            {
                list.elements_owned = false;
            }

            return(result);
        }
Ejemplo n.º 2
0
        public static T [] ListToArray <T> (ListBase list)
        {
            int count  = list.Count;
            var result = new T [count];

            if (count > 0)
            {
                list.CopyTo(result, 0);
            }

            if (typeof(T).IsSubclassOf(typeof(GLib.Opaque)))
            {
                list.elements_owned = false;
            }

            return(result);
        }
Ejemplo n.º 3
0
        public static Array ListToArray(ListBase list, System.Type type)
        {
            Array result = Array.CreateInstance (type, list.Count);
            if (list.Count > 0)
                list.CopyTo (result, 0);

            if (type.IsSubclassOf (typeof (GLib.Opaque)))
                list.elements_owned = false;

            return result;
        }