diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-10-03 10:14:03 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-10-03 10:14:03 +0200 |
commit | f37850249db6304c4df1c088f351a6ceac6a8691 (patch) | |
tree | b3264aa97ca189ae057cc3933e0126f8b25d15b2 | |
parent | b08ca4a640d6b067c5767704008de864d442cd6b (diff) |
Add Object.HasProperty()
-rw-r--r-- | gstreamer-sharp/Object.custom | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gstreamer-sharp/Object.custom b/gstreamer-sharp/Object.custom index f02812c..bf71bb6 100644 --- a/gstreamer-sharp/Object.custom +++ b/gstreamer-sharp/Object.custom @@ -31,6 +31,16 @@ public PropertyInfo GetPropertyInfo (string property) { return new PropertyInfo (pspec); } +public bool HasProperty (string property) { + IntPtr klass = Marshal.ReadIntPtr (Handle); + + IntPtr native_property = Gst.GLib.Marshaller.StringToPtrGStrdup (property); + IntPtr pspec = g_object_class_find_property (klass, native_property); + Gst.GLib.Marshaller.Free (native_property); + + return pspec != IntPtr.Zero; +} + public PropertyInfo[] Properties { get { uint n_properties; |