From f37850249db6304c4df1c088f351a6ceac6a8691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 3 Oct 2009 10:14:03 +0200 Subject: [PATCH] Add Object.HasProperty() --- gstreamer-sharp/Object.custom | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gstreamer-sharp/Object.custom b/gstreamer-sharp/Object.custom index f02812c215..bf71bb6579 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;