Exemplo n.º 1
0
        private void MainWindow_Load(object sender, EventArgs e)
        {
            webView.SetCspCheckEnable(false);
            webView.CookieEnabled = true;
            webView.NavigationToNewWindowEnable = false;

            webView.OnTitleChange += new EventHandler <TitleChangeEventArgs>(OnWebViewTitleChange);
            //webView.OnURLChange += new EventHandler<UrlChangeEventArgs>(OnWebViewURLChange);
            //webView.OnLoadingFinish += new EventHandler<LoadingFinishEventArgs>(OnWebViewLoadingFinish);
            //webView.OnLoadUrlBegin += new EventHandler<LoadUrlBeginEventArgs>(OnWebViewLoadUrlBegin);
            //webView.OnDocumentReady += new EventHandler<DocumentReadyEventArgs>(OnWebViewDocumentReady);
            //webView.OnDownload += new EventHandler<DownloadEventArgs>(OnWebViewDownload);

            #region BindFunction
            JsValue.BindFunction("OnLogin", new wkeJsNativeFunction(OnLogin), 2);
            JsValue.BindFunction("OnLogout", new wkeJsNativeFunction(OnLogout), 0);
            JsValue.BindGetter("ServerUri", new wkeJsNativeFunction(GetServerUri));
            JsValue.BindGetter("Token", new wkeJsNativeFunction(GetToken));
            JsValue.BindSetter("Token", new wkeJsNativeFunction(SetToken));
            JsValue.BindFunction("Dial", new wkeJsNativeFunction(OnDial), 3);
            #endregion

            //var devToolPath ="file:///" + (Application.StartupPath + @"\front_end\inspector.html").Replace("\\","/");
            var devToolPath = "file:///D:/test/miniblinknet/Demo/bin/Debug/front_end/inspector.html";
            //webView.SetDebugConfig("showDevTools", devToolPath);
            //webView.ShowDevtools(devToolPath, null, IntPtr.Zero);
            //webView.LoadFile(@"Assets\pages\login.html");
            webView.LoadFile(@"Assets\pages\login.html");

            vpxWindow = new VPXWindow();
            toolbar   = new MFWToolBar();
            toolbar.BindPanel(vpxWindow.pnlContainer);
            MFWCore.MFWEvent += MFWEventHandle;

            deviceManager.PropertyChanged += OnPropertyChangedEventHandler;

            var userName = "******";
            var pwd      = "123456789";
            MFWCore.Register(SipServer, userName, pwd, vpxWindow.pnlContainer);
        }