Exemple #1
0
 internal void Attach(CefBrowser browser)
 {
     FBrowser = browser;
     FBrowser.SetSize(CefPaintElementType.View, FSize.Width, FSize.Height);
     FBrowser.SendFocusEvent(true);
     FErrorText = string.Empty;
     FBrowserAttachedEvent.Set();
 }
        internal void Attach(CefBrowser browser)
        {
            lock (FLock)
            {
                if (FBrowser != null)
                {
                    throw new InvalidOperationException("Browser already attached.");
                }

                FBrowser = browser;
                FBrowser.SetSize(CefPaintElementType.View, FWidth, FHeight);
            }
        }
        private void SetDimensions(int width, int height)
        {
            // Normalize inputs
            width  = Math.Max(1, width);
            height = Math.Max(1, height);

            if (width != FWidth || height != FHeight)
            {
                FTextureResource.Dispose();
                FWidth  = width;
                FHeight = height;
                FBrowser.SetSize(CefPaintElementType.View, width, height);
            }
        }