示例#1
0
        public void Configure(int width, int height, string url)
        {
            _width  = width;
            _height = height;
            _url    = url;

            CefCreateInstanceEvent createEvent = new CefCreateInstanceEvent()
            {
                Width      = width,
                Height     = height,
                Url        = url,
                InstanceID = InstanceID
            };

            SendEvent(createEvent);
        }
示例#2
0
        private static void EventReceivedHandler(object sender, EventReceivedEventArgs args)
        {
            CefEvent cefEvent = args.CefEvent;

            if (cefEvent is CefCreateInstanceEvent)
            {
                CefCreateInstanceEvent createEvent = (CefCreateInstanceEvent)cefEvent;

                InstanceManager.CreateInstance(createEvent.InstanceID);
                CefInstance cefInstance = InstanceManager.GetInstance(createEvent.InstanceID);

                cefInstance.Width  = createEvent.Width;
                cefInstance.Height = createEvent.Height;
                cefInstance.Url    = createEvent.Url;

                cefInstance.Start();

                return;
            }

            InstanceManager.GetInstance(cefEvent.InstanceID).ReceiveEvent(cefEvent);
        }