internal static CfxCommandLine Wrap(IntPtr nativePtr)
 {
     if (nativePtr == IntPtr.Zero)
     {
         return(null);
     }
     lock (weakCache) {
         var wrapper = (CfxCommandLine)weakCache.Get(nativePtr);
         if (wrapper == null)
         {
             wrapper = new CfxCommandLine(nativePtr);
             weakCache.Add(wrapper);
         }
         else
         {
             CfxApi.cfx_release(nativePtr);
         }
         return(wrapper);
     }
 }
 /// <summary>
 /// Returns the singleton global CfxCommandLine object. The returned object
 /// will be read-only.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_command_line_capi.h">cef/include/capi/cef_command_line_capi.h</see>.
 /// </remarks>
 public static CfxCommandLine GetGlobal()
 {
     return(CfxCommandLine.Wrap(CfxApi.CommandLine.cfx_command_line_get_global()));
 }
 /// <summary>
 /// Create a new CfxCommandLine instance.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_command_line_capi.h">cef/include/capi/cef_command_line_capi.h</see>.
 /// </remarks>
 public static CfxCommandLine Create()
 {
     return(CfxCommandLine.Wrap(CfxApi.CommandLine.cfx_command_line_create()));
 }
 /// <summary>
 /// Returns a writable copy of this object.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_command_line_capi.h">cef/include/capi/cef_command_line_capi.h</see>.
 /// </remarks>
 public CfxCommandLine Copy()
 {
     return(CfxCommandLine.Wrap(CfxApi.CommandLine.cfx_command_line_copy(NativePtr)));
 }
Esempio n. 5
0
 /// <summary>
 /// Launches the process specified via |commandLine|. Returns true (1) upon
 /// success. Must be called on the browser process TID_PROCESS_LAUNCHER thread.
 /// Unix-specific notes: - All file descriptors open in the parent process will
 /// be closed in the
 /// child process except for stdin, stdout, and stderr.
 /// - If the first argument on the command line does not contain a slash,
 /// PATH will be searched. (See man execvp.)
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_process_util_capi.h">cef/include/capi/cef_process_util_capi.h</see>.
 /// </remarks>
 public static bool LaunchProcess(CfxCommandLine commandLine)
 {
     return(0 != CfxApi.cfx_launch_process(CfxCommandLine.Unwrap(commandLine)));
 }