コード例 #1
0
        public MainWindow()
        {
            InitializeComponent();

            /*
             *
             * If DevTools are not required, this can be configured
             */


            var settings = new CefSharp.Settings
            {
                PackLoadingDisabled = false,
            };


            if (!CEF.Initialize(settings))
            {
                MessageBox.Show("Could not initialize CEF");
            }
            else
            {
                var webView = new WebView();
                webView.Height = 0;
                webView.Width  = 0;
                mainPanel.Children.Add(webView);
            }
        }
コード例 #2
0
        public MainWindow()
        {
            InitializeComponent();
            this.DataContext                   = new MainViewModel(new FileDialogService(), Viewport, RotatorX, RotatorY, RotatorZ, ScaleXYZ, config);
            FracktoryWindow.Loaded            += new RoutedEventHandler(win_Loaded);
            FracktoryWindow.SourceInitialized += new EventHandler(win_SourceInitialized);

            CefSharp.Settings        settings        = new CefSharp.Settings();
            CefSharp.BrowserSettings browserSettings = new BrowserSettings();
            browserSettings.FileAccessFromFileUrlsAllowed      = true;
            browserSettings.UniversalAccessFromFileUrlsAllowed = true;
            browserSettings.TextAreaResizeDisabled             = true;

            settings.PackLoadingDisabled = true;
            if (CEF.Initialize(settings))
            {
                CefSharp.Wpf.WebView web_view = new CefSharp.Wpf.WebView(AssemblyDirectory + @"/gCodeViewer/index.html", browserSettings);
                grid1.Children.Add(web_view);

                //730 x 460

                // web_view.Address = "file:///E:/Fracktal/gCodeViewer-master2/index.html";
            }
            //Uri uri = new Uri(@"pack://application:,,,/gCodeViewer/index.html");
            //Stream source = Application.GetContentStream(uri).Stream;
            //wbMain.NavigateToStream(source);
        }
コード例 #3
0
 public static void Init()
 {
     CefSharp.Settings settings = new CefSharp.Settings();
     if (CEF.Initialize(settings))
     {
         CEF.RegisterScheme("theme", new ThemeSchemeHandlerFactory());
         //CEF.RegisterScheme("test", new SchemeHandlerFactory());
         //CEF.RegisterJsObject("bound", new BoundObject());
     }
 }
コード例 #4
0
 public static void Init()
 {
     CefSharp.Settings settings = new CefSharp.Settings();
     if (CEF.Initialize(settings))
     {
         CEF.RegisterScheme("theme", new ThemeSchemeHandlerFactory());
         //CEF.RegisterScheme("test", new SchemeHandlerFactory());
         //CEF.RegisterJsObject("bound", new BoundObject());
     }
 }
コード例 #5
0
        public virtual void InitControl()
        {
            var    settings    = new CefSharp.Settings();
            string currentPath = Application.StartupPath;

            settings.AddPluginPath(currentPath + @"\NPSWF32.dll");

            if (!CEF.IsInitialized)
            {
                CEF.Initialize(settings);
            }
            LoadBrowser();
        }
コード例 #6
0
        public static void Init(IEventAggregator eventAggregator)
        {
            CefSharp.Settings settings = new CefSharp.Settings();

            if (CEF.Initialize(settings))
            {
                CEF.RegisterScheme("theme", new ThemeSchemeHandlerFactory());
                //CEF.RegisterScheme("test", new SchemeHandlerFactory());
                //CEF.RegisterJsObject("bound", new BoundObject());
                CEF.RegisterScheme("md", new MarkdownHandlerFactory(eventAggregator, () => DocDirectory));
                //CEF.RegisterJsObject("MDLink", new MDLink());
            }
        }
コード例 #7
0
        public static void Init(IEventAggregator eventAggregator)
        {
            CefSharp.Settings settings = new CefSharp.Settings();

            if (CEF.Initialize(settings))
            {
                CEF.RegisterScheme("theme", new ThemeSchemeHandlerFactory());
                //CEF.RegisterScheme("test", new SchemeHandlerFactory());
                //CEF.RegisterJsObject("bound", new BoundObject());
                CEF.RegisterScheme("md", new MarkdownHandlerFactory(eventAggregator,() => DocDirectory ));
                //CEF.RegisterJsObject("MDLink", new MDLink());
            }
        }
コード例 #8
0
        public static void InitializeChromiumEmbedded()
        {
            _isCefInitialized = true;

            var settings = new CefSharp.Settings
            {
                PackLoadingDisabled = false,
            };

            if (!CEF.Initialize(settings))
            {
                throw new Exception("Could not initialize CEF");
            }
        }
コード例 #9
0
        public static void InitializeChromiumEmbedded()
        {
            _isCefInitialized = true;

            var settings = new CefSharp.Settings
            {
                PackLoadingDisabled = false,
            };

            if (!CEF.Initialize(settings))
            {
                throw new Exception("Could not initialize CEF");
            }
        }
コード例 #10
0
        private void InitChrome()
        {
            var settings = new CefSharp.Settings
            {
                PackLoadingDisabled = true,
            };

            if (CEF.Initialize(settings))
            {
                _webView         = new WebView();
                _webView.Loaded += _webView_Loaded;
                gridBrowser.Children.Add(_webView);
            }
        }
コード例 #11
0
ファイル: Program.cs プロジェクト: rastating/yaircc
        public static void Main()
        {
            if (!System.Diagnostics.Debugger.IsAttached)
            {
                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);
                AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
            }

            CefSharp.Settings settings = new CefSharp.Settings();
            settings.CachePath = string.Empty;
            CEF.Initialize(settings);
            Application.ApplicationExit += Application_ApplicationExit;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
        }
コード例 #12
0
        public static void Main()
        {
            if (!System.Diagnostics.Debugger.IsAttached)
            {
                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);
                AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
            }

            CefSharp.Settings settings = new CefSharp.Settings();
            settings.CachePath = string.Empty;
            CEF.Initialize(settings);
            Application.ApplicationExit += Application_ApplicationExit;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
        }
コード例 #13
0
        public MessageRendererWebBrowserChrome()
        {
            var settings = new CefSharp.Settings
            {
                PackLoadingDisabled = true,

            };

            if (CEF.Initialize(settings))
            {
                InitializeComponent();
            }
            else
            {
                Console.Out.WriteLine("CANNOT INITIALIZE");
            }
        }
コード例 #14
0
ファイル: xMainWindow.cs プロジェクト: thirudravidan/MySample
        /// <summary>
        /// //Set Borwser Settings
        /// </summary>
        public void SetURl()
        {
            var settings = new CefSharp.Settings
            {
                PackLoadingDisabled = true,
            };


            Settings.Default.IsNetwork = isNetworkAvailable.ToString();
            Settings.Default.Save();
            if (ConfigurationManager.AppSettings["DeploymentType"] == "L")
            {
                strAddress = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), Globals.ProductName, strCurrentVersion, ((Globals.ProductName == "GearHead Connect") ? "GearHeadConnect" : Globals.ProductName) + "Offline\\index.html");
            }
            else
            {
                strAddress = ConfigurationManager.AppSettings["LocalUrl"];
            }
            BrowserSettings browserSettings = new BrowserSettings();
            browserSettings.FileAccessFromFileUrlsAllowed = true;
            browserSettings.UniversalAccessFromFileUrlsAllowed = true;
            browserSettings.TextAreaResizeDisabled = true;
            if (CEF.Initialize(settings))
            {
                chromiumBrowser = new WebView(strAddress, browserSettings);
            }

            //chromiumBrowser.Address = strAddress;
            chromiumBrowser.Dock = DockStyle.Fill;
            chromiumBrowser.RegisterJsObject("external", this);
            chromiumBrowser.LoadCompleted += new LoadCompletedEventHandler(onLoadCompleted);
            uxWebBrowserPannel.Controls.Add(chromiumBrowser);
            //renderChromiumBrowser(chromiumBrowser, strAddress);
        }
コード例 #15
-1
        public BrowserForm()
        {
            InitializeComponent();

            var CefSettings = new CefSharp.Settings()
            {
                PackLoadingDisabled = true
            };

            do
            {
                CefSharp.CEF.Initialize(CefSettings);
            }
            while (!CefSharp.CEF.IsInitialized);

            webView = new WebView("https://trello.com/board/kinect-development/508d9bbfb3b2cd791f005e32", new BrowserSettings());
            webView.Dock = DockStyle.Fill;
            browserContainer.ContentPanel.Controls.Add(webView);

            kinectControl = new KinectControl(this);
        }
コード例 #16
-1
ファイル: MainWindow.cs プロジェクト: BSilberzahn/MkvCompare
        public MainWindow()
        {
            InitializeComponent();

             var settings = new CefSharp.Settings
            {
                PackLoadingDisabled = true,
            };

             if (CEF.Initialize(settings))
             {
                 BrowserSettings browserSettings = new BrowserSettings();
                 browserSettings.FileAccessFromFileUrlsAllowed = true;
                 browserSettings.UniversalAccessFromFileUrlsAllowed = true;
                 browserSettings.TextAreaResizeDisabled = true;

                 this.webView = new WebView(Application.StartupPath + @"\res\www\index.html", browserSettings);

                 this.webView.Dock = DockStyle.Fill;
                 this.toolStripContainer.ContentPanel.Controls.Add(webView);
             }
        }