Пример #1
0
 static void ManagedNotify(IntPtr object_, IntPtr pspec_)
 {
     try {
         var obj   = Object.GetInstance(object_, Transfer.None);
         var pspec = ParamSpec.GetInstance(pspec_, Transfer.None);
         // FIXME
     } catch (Exception ex) {
         ex.LogUnhandledException();
     }
 }
Пример #2
0
        /// <summary>
        /// Looks up the <see cref="ParamSpec"/> for a property of a class.
        /// </summary>
        /// <param name="propertyName">
        /// the name of the property to look up
        /// </param>
        /// <returns>
        /// the <see cref="ParamSpec"/> for the property, or
        /// <c>null</c> if the class doesn't have a property of that name
        /// </returns>
        /// <exception cref="ArgumentNullException">
        /// Throw when <paramref name="propertyName"/> is <c>null</c>
        /// </exception>
        public ParamSpec FindProperty(string propertyName)
        {
            if (propertyName == null)
            {
                throw new ArgumentNullException(nameof(propertyName));
            }
            var propertyName_ = GMarshal.StringToUtf8Ptr(propertyName);
            var ret_          = g_object_class_find_property(Handle, propertyName_);
            var ret           = ParamSpec.GetInstance(ret_, Transfer.None);

            GMarshal.Free(propertyName_);
            return(ret);
        }
Пример #3
0
        static void ManagedClassGetProperty(IntPtr objPtr, uint propertyId, ref Value value, IntPtr pspecPtr)
        {
            try {
                var obj   = Object.GetInstance(objPtr, Transfer.None);
                var pspec = ParamSpec.GetInstance(pspecPtr, Transfer.None);

                var propInfo = (PropertyInfo)pspec[managedClassPropertyInfoQuark];
                value.Set(propInfo.GetValue(obj));
            }
            catch (Exception ex) {
                ex.LogUnhandledException();
            }
        }
Пример #4
0
            bool walk_ancestors); // gboolean

        public ParamSpec Lookup(string paramName, GType ownerType, bool walkAncestors)
        {
            AssertNotDisposed();
            if (paramName == null)
            {
                throw new ArgumentNullException(nameof(paramName));
            }
            var paramNamePtr = GMarshal.StringToUtf8Ptr(paramName);
            var retPtr       = g_param_spec_pool_lookup(Handle, paramNamePtr, ownerType, walkAncestors);

            GMarshal.Free(paramNamePtr);
            var ret = ParamSpec.GetInstance(retPtr, Transfer.None);

            return(ret);
        }