예제 #1
0
        static public IResultOrError <IBrowserProcess> ReuseOrCreateProcess(
            this IApp app,
            Interface.BrowserProcessConfig browserProcessConfig = null)
        {
            var Process = app?.ReuseProcess(browserProcessConfig);

            if (!(Process?.Result).CanReuseProcess(browserProcessConfig))
            {
                Process?.Result?.Kill();

                Process = app?.CreateProcess(browserProcessConfig);
            }

            return(Process);
        }
예제 #2
0
 /// <summary>
 /// Hosting App provides the BrowserProcessConfig as specified in UI.
 /// </summary>
 /// <param name="app"></param>
 /// <returns></returns>
 static public IResultOrError <IBrowserProcess> CreateProcess(this IApp app) => app.CreateProcess(null);