예제 #1
0
        /// <summary>
        /// Initializes a new instance of <see cref="BrowserForm"/> class.
        /// </summary>
        public BrowserForm(IKimsufiAvaibilityCheckerServiceListener serviceListener)
        {
            InitializeComponent();

            this.serviceListener = serviceListener;

            Text    = "CefSharp";
            Visible = true;

            browser = new ChromiumWebBrowser("about:blank")
            {
            };
            FormClosed += new FormClosedEventHandler(BrowserForm_FormClosed);


            // Register BrowserCallbackForJs class as javascript callback.
            browser.RegisterJsObject("dotnetcallback", new BrowserCallbackForJs(this));

            toolStripContainer.ContentPanel.Controls.Add(browser);

            browser.LoadingStateChanged += OnLoadingStateChanged;
            browser.ConsoleMessage      += OnBrowserConsoleMessage;
            browser.StatusMessage       += OnBrowserStatusMessage;
            browser.TitleChanged        += OnBrowserTitleChanged;
            browser.AddressChanged      += OnBrowserAddressChanged;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="KimsufiAvaibilityChecker"/> class with a specific event listener.
 /// </summary>
 /// <param name="listener">The event listener used by this class.</param>
 public KimsufiAvaibilityCheckerService(IKimsufiAvaibilityCheckerServiceListener listener, IBrowserService browser)
 {
     this.listener = listener;
     this.browser  = browser;
 }