public virtual IBrowserWindow GetOrCreateBrowserWindow(IApplication application) { if (application == null) { throw new ArgumentNullException("application"); } var applicationId = application.Id; if (string.IsNullOrEmpty(applicationId)) { throw new ArgumentNullException("application.Id"); } lock (_lockObject) { if (!_browserWindows.ContainsKey(applicationId)) { var model = new BrowserViewModel() { Application = application, Session = Session }; _uiHelper.PerformInUiThread(() => { var browserWindow = _browserWindowsBuilder.CreateBrowserWindow(model); _browserWindows[applicationId] = browserWindow; }); } return(_browserWindows[applicationId]); } }
public void DisplayApplication(IApplication application) { var browserWindow = _browserWindowsManager.GetOrCreateBrowserWindow(application); _uiHelper.PerformInUiThread(() => { browserWindow.Display(); }); }
protected override void OnCursorChange(CefBrowser browser, IntPtr cursorHandle, CefCursorType type, CefCursorInfo customCursorInfo) { _uiHelper.PerformInUiThread(() => { //Cursor cursor = CursorInteropHelper.Create(new SafeFileHandle(cursorHandle, false)); //_owner.Cursor = cursor; }); }
protected override void OnCursorChange(CefBrowser browser, IntPtr cursorHandle) { _uiHelper.PerformInUiThread(() => { Cursor cursor = CursorInteropHelper.Create(new SafeFileHandle(cursorHandle, false)); _owner.Cursor = cursor; }); }
private void ReloadSessions() { var session = _mainAppClient.GetSession(); if ((session == null) || (session.Cookies.Count <= 0)) { return; } _browserWindowsManager.Session = session; var apps = _mainAppClient.GetMyApps(); _browserWindowsManager.Applications = apps; _uiHelper.PerformInUiThread(() => { foreach (var app in apps) { if ((app == null) || string.IsNullOrEmpty(app.UrlString) || _browserWindows.ContainsKey(app.Id)) { continue; } var model = new BrowserViewModel() { Application = app, Session = session }; var browserWindow = _browserWindowsBuilder.CreateBrowserWindow(model); _browserWindows[app.Id] = browserWindow; } }); foreach (var browserWindow in _browserWindows.Values) { browserWindow.SetSession(session); } }
public static void PerformInUiThread(Action action) { UiHelper.PerformInUiThread(action); }