예제 #1
0
 protected virtual void OnAskPassword(string message, string default_user, string default_domain, GLib.AskPasswordFlags flags)
 {
     GLib.Value      ret             = GLib.Value.Empty;
     GLib.ValueArray inst_and_params = new GLib.ValueArray(5);
     GLib.Value[]    vals            = new GLib.Value [5];
     vals [0] = new GLib.Value(this);
     inst_and_params.Append(vals [0]);
     vals [1] = new GLib.Value(message);
     inst_and_params.Append(vals [1]);
     vals [2] = new GLib.Value(default_user);
     inst_and_params.Append(vals [2]);
     vals [3] = new GLib.Value(default_domain);
     inst_and_params.Append(vals [3]);
     vals [4] = new GLib.Value(flags);
     inst_and_params.Append(vals [4]);
     g_signal_chain_from_overridden(inst_and_params.ArrayPtr, ref ret);
     foreach (GLib.Value v in vals)
     {
         v.Dispose();
     }
 }
예제 #2
0
 protected virtual void OnAskPassword(string message, string default_user, string default_domain, GLib.AskPasswordFlags flags)
 {
     InternalAskPassword(message, default_user, default_domain, flags);
 }
예제 #3
0
        private void InternalAskPassword(string message, string default_user, string default_domain, GLib.AskPasswordFlags flags)
        {
            AskPasswordNativeDelegate unmanaged = null;

            unsafe {
                IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("ask_password"));
                unmanaged = (AskPasswordNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(AskPasswordNativeDelegate));
            }
            if (unmanaged == null)
            {
                return;
            }

            IntPtr native_message        = GLib.Marshaller.StringToPtrGStrdup(message);
            IntPtr native_default_user   = GLib.Marshaller.StringToPtrGStrdup(default_user);
            IntPtr native_default_domain = GLib.Marshaller.StringToPtrGStrdup(default_domain);

            unmanaged(this.Handle, native_message, native_default_user, native_default_domain, (int)flags);
            GLib.Marshaller.Free(native_message);
            GLib.Marshaller.Free(native_default_user);
            GLib.Marshaller.Free(native_default_domain);
        }
예제 #4
0
        private void InternalAskPassword(string message, string default_user, string default_domain, GLib.AskPasswordFlags flags)
        {
            AskPasswordNativeDelegate unmanaged = class_abi.BaseOverride <AskPasswordNativeDelegate>(this.LookupGType(), "ask_password");

            if (unmanaged == null)
            {
                return;
            }

            IntPtr native_message        = GLib.Marshaller.StringToPtrGStrdup(message);
            IntPtr native_default_user   = GLib.Marshaller.StringToPtrGStrdup(default_user);
            IntPtr native_default_domain = GLib.Marshaller.StringToPtrGStrdup(default_domain);

            unmanaged(this.Handle, native_message, native_default_user, native_default_domain, (int)flags);
            GLib.Marshaller.Free(native_message);
            GLib.Marshaller.Free(native_default_user);
            GLib.Marshaller.Free(native_default_domain);
        }