protected override unsafe void BeforeReturn(IntPtr dialog, DialogResult result) { base.BeforeReturn(dialog, result); var filesPtr = Gtk.Dialog.GetSelectedFiles(dialog); var files = new List <string>(); if (filesPtr != IntPtr.Zero) { try { var list = Marshal.PtrToStructure <GSList>(filesPtr); while (true) { using (var value = new GLibString(list.Data)) { files.Add(value.ToString()); } if (list.Next == null) { break; } list = *list.Next; } } finally { GLib.FreeSList(filesPtr); } } SelectedFiles = files.ToArray(); }