Esempio n. 1
0
        protected override void OnHandleCreated(EventArgs e)
        {
            base.OnHandleCreated(e);

            SciterApi.SciterSetOption(IntPtr.Zero, SciterXDef.SCITER_RT_OPTIONS.SCITER_SET_DEBUG_MODE, new IntPtr(1));

            SciterWindow = SciterWindow
                           .CreateChildWindow(Handle);

            Host.SetupWindow(SciterWindow)
            .AttachEventHandler(HostEventHandler);

            if (LoadUri != null)
            {
                var loadUriEventArgs = new LoadUriEventArgs();

                LoadUri?.Invoke(this, loadUriEventArgs);
                Host.Window.TryLoadPage(loadUriEventArgs.Uri);
            }
            else
            {
                var loadHtmlEventArgs = new LoadHtmlEventArgs()
                {
                    Html = Html
                };

                LoadHtml?.Invoke(this, loadHtmlEventArgs);
                Host.Window.LoadHtml(loadHtmlEventArgs?.Html ?? this.Html ?? string.Format(DEFAULT_HTML, Name));
            }

            OnClientSizeChanged(EventArgs.Empty);
            Host.Window.Show();
            //Host.ConnectToInspector();
        }
Esempio n. 2
0
 private void sciterControl1_LoadHtml(object sender, SciterCore.WinForms.LoadHtmlEventArgs e)
 {
     e.Html =
         "<body>" +
         "<code>Add an event handler to the <b>HandleCreated</b> event for any needed initialization (e.g.: load the HTML)</code><br /><br />" +
         "<code>In the handler, use the <b>SciterWnd</b> property of this control to access the SciterWindow instance.</code>" +
         "</body>";
 }
Esempio n. 3
0
 private void SciterControl1OnLoadHtml(object?sender, LoadHtmlEventArgs e)
 {
     e.Html =
         "<body>" +
         "<code>Add an event handler to the <b>HandleCreated</b> event for any needed initialization (e.g.: load the HTML)</code><br /><br />" +
         $"<code>In the handler, use the <b>{nameof(sciterControl1.SciterWindow)}</b> property of this control to access the SciterWindow instance.</code>" +
         "</body>";
 }