internal ListBase(IntPtr list, System.Type element_type, bool owned, bool elements_owned, ListElementFree free_func) { list_ptr = list; this.element_type = element_type; managed = owned; this.elements_owned = elements_owned; this.free_func = free_func; }
internal PtrArray(IntPtr raw, System.Type element_type, bool owned, bool elements_owned, ListElementFree free_func) { handle = raw; this.element_type = element_type; managed = owned; this.elements_owned = elements_owned; this.free_func = free_func; }
public static T [] ListPtrToArray <T> (IntPtr list_ptr, Type list_type, bool owned, bool elements_owned, ListElementFree free_func) { ListBase list; if (list_type == typeof(GLib.List)) { list = new GLib.List(list_ptr, typeof(T), owned, elements_owned, free_func); } else { list = new GLib.SList(list_ptr, typeof(T), owned, elements_owned, free_func); } using (list) return(ListToArray <T> (list)); }
public static T [] PtrArrayToArray <T> (IntPtr list_ptr, bool owned, bool elements_owned, ListElementFree free_func) { var elem_type = typeof(T); GLib.PtrArray array = new GLib.PtrArray(list_ptr, elem_type, owned, elements_owned, free_func); T [] ret = new T [array.Count]; array.CopyTo(ret, 0); array.Dispose(); return(ret); }
public SList(IntPtr raw, System.Type element_type, bool owned, bool elements_owned, ListElementFree free_func) : base(raw, element_type, owned, elements_owned, free_func) { }