public void BindMatrixSetting(GLib.Settings settings, string key, GLib.SettingsBindFlags flags) { IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup(key); gtk_source_space_drawer_bind_matrix_setting(Handle, settings == null ? IntPtr.Zero : settings.Handle, native_key, (int)flags); GLib.Marshaller.Free(native_key); }
public void Bind(string key, IntPtr objekt, string property, GLib.SettingsBindFlags flags) { IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup(key); IntPtr native_property = GLib.Marshaller.StringToPtrGStrdup(property); g_settings_bind(Handle, native_key, objekt, native_property, (int)flags); GLib.Marshaller.Free(native_key); GLib.Marshaller.Free(native_property); }
public void BindWithMapping(string key, IntPtr objekt, string property, GLib.SettingsBindFlags flags, GLib.SettingsBindGetMapping get_mapping, GLib.SettingsBindSetMapping set_mapping) { IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup(key); IntPtr native_property = GLib.Marshaller.StringToPtrGStrdup(property); GLibSharp.SettingsBindGetMappingWrapper get_mapping_wrapper = new GLibSharp.SettingsBindGetMappingWrapper(get_mapping); GLibSharp.SettingsBindSetMappingWrapper set_mapping_wrapper = new GLibSharp.SettingsBindSetMappingWrapper(set_mapping); IntPtr user_data; GLib.DestroyNotify destroy; if (set_mapping == null) { user_data = IntPtr.Zero; destroy = null; } else { user_data = (IntPtr)GCHandle.Alloc(set_mapping_wrapper); destroy = GLib.DestroyHelper.NotifyHandler; } g_settings_bind_with_mapping(Handle, native_key, objekt, native_property, (int)flags, get_mapping_wrapper.NativeDelegate, set_mapping_wrapper.NativeDelegate, user_data, destroy); GLib.Marshaller.Free(native_key); GLib.Marshaller.Free(native_property); }