mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-23 19:15:27 +00:00
Variant: Add Type property
This commit is contained in:
parent
dc0f50729a
commit
4158bc99f8
|
@ -60,6 +60,18 @@ namespace GLib {
|
||||||
this.handle = g_variant_ref_sink (handle);
|
this.handle = g_variant_ref_sink (handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
static extern IntPtr g_variant_get_type (IntPtr val);
|
||||||
|
|
||||||
|
VariantType type;
|
||||||
|
public VariantType Type {
|
||||||
|
get {
|
||||||
|
if (type == null)
|
||||||
|
type = new VariantType (g_variant_get_type (Handle));
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern IntPtr g_variant_new_variant (IntPtr val);
|
static extern IntPtr g_variant_new_variant (IntPtr val);
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,8 @@ namespace sample
|
||||||
var asv = variant.ToAsv ();
|
var asv = variant.ToAsv ();
|
||||||
Console.WriteLine ("strv: " + asv["strv"].Print(true));
|
Console.WriteLine ("strv: " + asv["strv"].Print(true));
|
||||||
Console.WriteLine ("unit: " + asv["unit"].Print(true));
|
Console.WriteLine ("unit: " + asv["unit"].Print(true));
|
||||||
|
|
||||||
|
Console.WriteLine ("type: " + variant.Type.ToString ());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Main (string[] args)
|
public static void Main (string[] args)
|
||||||
|
|
Loading…
Reference in a new issue