mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-16 19:44:45 +02:00
21 lines
660 B
Plaintext
21 lines
660 B
Plaintext
|
[DllImport ("libgtk-win32-2.0-0.dll")]
|
||
|
static extern IntPtr gtk_file_chooser_get_filenames (IntPtr raw);
|
||
|
|
||
|
[DllImport("libglib-2.0-0.dll")]
|
||
|
static extern void g_strfreev (IntPtr handle);
|
||
|
|
||
|
public string[] Filenames {
|
||
|
get {
|
||
|
IntPtr strv = gtk_file_chooser_get_filenames (Handle);
|
||
|
System.Collections.ArrayList result = new System.Collections.ArrayList ();
|
||
|
int i = 0;
|
||
|
IntPtr strptr = Marshal.ReadIntPtr (strv, IntPtr.Size * i++);
|
||
|
while (strptr != IntPtr.Zero) {
|
||
|
result.Add (Marshal.PtrToStringAnsi (strptr));
|
||
|
strptr = Marshal.ReadIntPtr (strv, IntPtr.Size * i++);
|
||
|
}
|
||
|
g_strfreev (strv);
|
||
|
return result.ToArray (typeof (string)) as string[];
|
||
|
}
|
||
|
}
|