本文整理汇总了C#中Host.SetupPage方法的典型用法代码示例。如果您正苦于以下问题:C# Host.SetupPage方法的具体用法?C# Host.SetupPage怎么用?C# Host.SetupPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Host
的用法示例。
在下文中一共展示了Host.SetupPage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
// Sciter needs this for drag'n'drop support; STAThread is required for OleInitialize succeess
int oleres = PInvokeWindows.OleInitialize(IntPtr.Zero);
Debug.Assert(oleres == 0);
// Create the window
var wnd = new SciterWindow();
wnd.CreateMainWindow(1500, 800);
wnd.CenterTopLevelWindow();
wnd.Title = "Sciter Bootstrap";
wnd.Icon = Properties.Resources.IconMain;
// Prepares SciterHost and then load the page
var host = new Host();
host.SetupWindow(wnd);
host.RegisterBehaviorHandler("DrawBitmap", typeof(DrawBitmapBehavior));
host.RegisterBehaviorHandler("DrawText", typeof(DrawTextBehavior));
host.RegisterBehaviorHandler("DrawGeometry", typeof(DrawGeometryBehavior));
host.AttachEvh(new HostEvh());
host.SetupPage("index.html");
// Show window and Run message loop
wnd.Show();
PInvokeUtils.RunMsgLoop();
}
示例2: DidFinishLaunching
public override void DidFinishLaunching(NSNotification notification)
{
wnd = new SciterWindow();
wnd.CreateMainWindow(800, 500);
wnd.CenterTopLevelWindow();
wnd.Title = "SciterSharp from OSX";
host = new Host();
host.SetupWindow(wnd);
host.AttachEvh(new HostEvh());
host.SetupPage("index.html");
//host.DebugInspect();
wnd.Show();
}
示例3: Main
static void Main(string[] args)
{
// TODO: think Andrew corrected child window creation
PInvokeWindows.OleInitialize(IntPtr.Zero);
// Create the window
var wnd = new SciterWindow();
wnd.CreateMainWindow(1500, 800);
wnd.Title = "Sciter Bootstrap";
wnd.CenterTopLevelWindow();
wnd.Icon = Properties.Resources.Icon1;
//wnd.EnableDwmClientArea();
//wnd.AfterWindowCreate();
// Prepares SciterHost and then load the page
var host = new Host();
host.SetupWindow(wnd);
host.AttachEvh(new HostEvh());
host.SetupPage("index.html");
//host.DebugInspect();
// get the page <body>
var se_body = wnd.RootElement.SelectFirst("body");
// append a <h1> header to it
se_body.TransformHTML("<h1>Wow, this header was created natively!</h1>", SciterXDom.SET_ELEMENT_HTML.SIH_INSERT_AT_START);
// set <h1> color to blue
se_body[0].SetStyle("color", "#00F");
/*SciterWindow wnd_popup = new SciterWindow();
wnd_popup.CreatePopupAlphaWindow(400, 400, wnd._hwnd);
wnd_popup.LoadHtml("<html><body><style>html { background: red; }</style></body></html>");
wnd_popup.Show();*/
// Show window and Run message loop
wnd.Show();
PInvokeUtils.RunMsgLoop();
}
示例4: Main
static void Main(string[] args)
{
#if WINDOWS
// Sciter needs this for drag'n'drop support; STAThread is required for OleInitialize succeess
int oleres = PInvokeWindows.OleInitialize(IntPtr.Zero);
Debug.Assert(oleres == 0);
#endif
#if GTKMONO
PInvokeGTK.gtk_init(IntPtr.Zero, IntPtr.Zero);
#endif
DbgHandler = new DebugHandlerGTK();
/*
NOTE:
In Linux, if you are getting a System.TypeInitializationException below, it is because you don't have 'libsciter-gtk-64.so' in your LD_LIBRARY_PATH.
Run 'sudo bash install-libsciter.sh' contained in this package to install it in your system.
*/
// Check minimum Sciter version required for this app
if(SciterX.API.SciterVersion(1) < 0x00030003 || SciterX.API.SciterVersion(0) < 0x00010002)
throw new Exception("Sciter shared library is outdated.");
// Create the window
var wnd = new SciterWindow();
wnd.CreateMainWindow(800, 600);
wnd.CenterTopLevelWindow();
wnd.Title = "Font Lister";
#if WINDOWS
wnd.Icon = Properties.Resources.IconMain;
#endif
// Prepares SciterHost and then load the page
var host = new Host();
host.SetupWindow(wnd);
host.AttachEvh(new HostEvh());
host.SetupPage("index.html");
host.DebugInspect();
HostInstance = host;
FontLister.Data.GAPI.Setup();
// Show window and Run message loop
wnd.Show();
PInvokeUtils.RunMsgLoop();
}