Esempio n. 1
0
 public IpcMessage(string name)
     : base(typeof (CefProcessMessage))
 {
     var s = new StringUtf16(name);
     Handle = CefProcessMessageCapi.CefProcessMessageCreate(s.Handle);
     s.Free();
 }
Esempio n. 2
0
 public static string ReadStringAndFree(IntPtr handle)
 {
     if (handle == IntPtr.Zero) {
         Debug.WriteLine("ReadStringAndFree: handle is null");
         return string.Empty;
     }
     var value = new StringUtf16(handle);
     var text = value.Text;
     value.Free();
     return text;
 }
Esempio n. 3
0
 public bool HasSwitch(string name)
 {
     var r = MarshalFromNative<CefCommandLine>();
     var function = (CefCommandLineCapiDelegates.HasSwitchCallback)
                    Marshal.GetDelegateForFunctionPointer(r.HasSwitch,
                                                          typeof (CefCommandLineCapiDelegates.HasSwitchCallback));
     var s = new StringUtf16(name);
     var hasSwitch = function(Handle, s.Handle);
     s.Free();
     return Convert.ToBoolean(hasSwitch);
 }