private void InitializeCore()
        {
            WebCoreConfig config = new WebCoreConfig() { EnablePlugins = true, SaveCacheAndCookies = true };
            WebCore.Initialize(config);

            if (Application.Current.MainWindow != null)
                Application.Current.MainWindow.Closing += ShutdownCore;

            CoreInitialized = true;
        }
        public MainWindow()
        {
            InitializeComponent();

            this.SourceInitialized += browserWindowSourceInitialized;
            txtAddress.KeyDown += txtAddressKeyDown;
            tabControl.SelectionChanged += tabControlChanged;

            // Setup Webcore with plugins enabled
            WebCoreConfig config = new WebCoreConfig { EnablePlugins = true };
            WebCore.Initialize(config);

            tabViewList = new ArrayList();
        }
Example #3
0
        public WebForm()
        {
            // Notice that Control.DoubleBuffered has been set to true
            // in the designer, to prevent flickering.

            InitializeComponent();

            WebCoreConfig config = new WebCoreConfig { EnablePlugins = true };
            WebCore.Initialize( config );

            webView = WebCore.CreateWebView( this.ClientSize.Width, this.ClientSize.Height );
            webView.IsDirtyChanged += OnIsDirtyChanged;
            webView.SelectLocalFiles += OnSelectLocalFiles;
            webView.CursorChanged += OnCursorChanged;
            webView.LoadURL( "http://www.google.com" );
            webView.Focus();
        }
Example #4
0
        public WebForm()
        {
            InitializeComponent();

            Resize += WebForm_Resize;
            webViewBitmap.MouseMove += WebForm_MouseMove;
            webViewBitmap.MouseDown += WebForm_MouseDown;
            webViewBitmap.MouseUp += WebForm_MouseUp;
            MouseWheel += WebForm_MouseWheel;
            KeyDown += WebForm_KeyDown;
            KeyUp += WebForm_KeyUp;
            KeyPress += WebForm_KeyPress;
            FormClosed += WebForm_FormClosed;
            Activated += WebForm_Activated;
            Deactivate += WebForm_Deactivate;

            WebCoreConfig config = new WebCoreConfig { EnablePlugins = true };
            WebCore.Initialize( config );

            webView = WebCore.CreateWebview( webViewBitmap.Width, webViewBitmap.Height );
            webView.IsDirtyChanged += OnIsDirtyChanged;
            webView.LoadURL( "http://www.google.com" );
            webView.Focus();
        }
Example #5
0
        private static void InitializeCore()
        {
            // We may be a new window in the same process.
            if ( !WebCore.IsRunning )
            {
                // Setup WebCore with plugins enabled.            
                WebCoreConfig config = new WebCoreConfig
                {
                    // !THERE CAN ONLY BE A SINGLE WebCore RUNNING PER PROCESS!
                    // We have ensured that our application is single instance,
                    // with the use of the WPFSingleInstance utility.
                    // We can now safely enable cache and cookies.
                    SaveCacheAndCookies = true,
                    // In case our application is installed in ProgramFiles,
                    // we wouldn't want the WebCore to attempt to create folders
                    // and files in there. We do not have the required privileges.
                    // Furthermore, it is important to allow each user account
                    // have its own cache and cookies. So, there's no better place
                    // than the Application User Data Path.
                    UserDataPath = My.Application.UserAppDataPath,
                    EnablePlugins = true,
                    HomeURL = Settings.Default.HomeURL,
                    // ...Se comments for UserDataPath.
                    LogPath = My.Application.UserAppDataPath,
                    // Let's gather some extra info for this sample.
                    LogLevel = LogLevel.Verbose
                };

                // Caution! Do not start the WebCore in window's constructor.
                // This may be a startup window and a synchronization context
                // (necessary for auto-update), may not be available during
                // construction; the Dispatcher may not be running yet 
                // (see App.xaml.cs).
                //
                // Setting the start parameter to false, let's us define
                // configuration settings early enough to be secure, but
                // actually delay the starting of the WebCore until
                // the first WebControl or WebView is created.
                WebCore.Initialize( config, false );
            }
        }
Example #6
0
        static void ConfigureWebCore()
        {
            EventInput.Initialize(GameClient.GameWindow);

            // Setup WebConfig Options
            WebCoreConfig Config = new WebCoreConfig();
            Config.EnablePlugins = true;
            Config.EnableDatabases = true;
            Console.WriteLine("WebUI: Configured");

            // Initialize HTML system
            WebCore.Initialize(Config, true);
            WebCore.BaseDirectory = Path.GetDirectoryName(
                    Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName
                ) + "\\UI\\UIStatic\\";

            Console.WriteLine("WebUI: Initialized");
        }