コード例 #1
0
 /// <summary>
 /// Attaches a window level event-handler: it receives every event for all elements of the page.
 /// You normally attaches it before loading the page HTML with <see cref="SciterWindowExtensions.LoadPage"/>
 /// You can only attach a single event-handler.
 /// </summary>
 public static bool TryAttachEventHandler(this SciterHost host, SciterEventHandler eventHandler)
 {
     return(host?.TryAttachEventHandlerInternal(eventHandler: eventHandler) == true);
 }
コード例 #2
0
 /// <summary>
 /// Detaches the event-handler previously attached with AttachEvh()
 /// </summary>
 public static SciterHost DetachEventHandler(this SciterHost host)
 {
     host?.DetachEventHandlerInternal();
     return(host);
 }
コード例 #3
0
 /// <summary>
 /// Attaches a window level event-handler: it receives every event for all elements of the page.
 /// You normally attaches it before loading the page HTML with <see cref="SciterWindowExtensions.LoadPage"/>
 /// You can only attach a single event-handler.
 /// </summary>
 public static SciterHost AttachEventHandler <THandler>(this SciterHost host)
     where THandler : SciterEventHandler
 {
     return(host?.AttachEventHandler(eventHandler: Activator.CreateInstance <THandler>()));
 }
コード例 #4
0
 /// <summary>
 /// Attaches a window level event-handler: it receives every event for all elements of the page.
 /// You normally attaches it before loading the page HTML with <see cref="SciterWindowExtensions.LoadPage"/>
 /// You can only attach a single event-handler.
 /// </summary>
 public static SciterHost AttachEventHandler <THandler>(this SciterHost host, Func <THandler> eventHandlerFunc)
     where THandler : SciterEventHandler
 {
     return(host?.AttachEventHandler(eventHandler: eventHandlerFunc.Invoke()));
 }
コード例 #5
0
 /// <summary>
 ///
 /// </summary>
 public static bool TryCallFunction(this SciterHost host, out SciterValue value, string functionName, params SciterValue[] args)
 {
     value = SciterValue.Null;
     return(host?.TryCallFunctionInternal(value: out value, functionName: functionName, args: args) == true);
 }
コード例 #6
0
 /// <summary>
 /// Attaches a window level event-handler: it receives every event for all elements of the page.
 /// You normally attaches it before loading the page HTML with <see cref="SciterWindowExtensions.LoadPage"/>
 /// You can only attach a single event-handler.
 /// </summary>
 public static SciterHost AttachEventHandler(this SciterHost host, SciterEventHandler eventHandler)
 {
     host?.AttachEventHandlerInternal(eventHandler: eventHandler);
     return(host);
 }
コード例 #7
0
 public static Task <SciterHost> ConnectToInspectorAsync(this SciterHost host)
 {
     host?.ConnectToInspectorInternalAsync();
     return(Task.FromResult(host));
 }
コード例 #8
0
 public SciterApplication(SciterHost host)
 {
     Host = host;
 }
コード例 #9
0
 public static SciterHost RegisterBehaviorHandler(this SciterHost host, Type eventHandlerType, string behaviorName = null)
 {
     host?.RegisterBehaviorHandlerInternal(eventHandlerType: eventHandlerType, behaviorName: behaviorName);
     return(host);
 }
コード例 #10
0
 public static SciterHost RegisterBehaviorHandler <TType>(this SciterHost host, string behaviorName = null)
     where TType : SciterEventHandler
 {
     host.RegisterBehaviorHandlerInternal <TType>(behaviorName: behaviorName);
     return(host);
 }
コード例 #11
0
 /// <summary>
 /// <para>Sciter cross-platform alternative for posting a message in the message queue.</para>
 /// <para>It will be received as a SC_POSTED_NOTIFICATION notification by this <see cref="SciterHost"/> instance.</para>
 /// <para>Override <see cref="SciterHost.OnPostedNotification"/> to handle it.</para>
 /// </summary>
 /// <param name="host"></param>
 /// <param name="wparam"></param>
 /// <param name="lparam"></param>
 /// <param name="timeout">
 /// If timeout is > 0 this methods SENDs the message instead of POSTing and this is the timeout for waiting the processing of the message. Leave it as 0 for actually POSTing the message.
 /// </param>
 public static IntPtr PostNotification(this SciterHost host, IntPtr wparam, IntPtr lparam, uint timeout = 0)
 {
     return(host?.PostNotificationInternal(wparam: wparam, lparam: lparam, timeout: timeout) ?? IntPtr.Zero);
 }
コード例 #12
0
 /// <summary>
 ///
 /// </summary>
 public static bool TryEvalScript(this SciterHost host, out SciterValue value, string script)
 {
     value = SciterValue.Null;
     return(host?.TryEvalScriptInternal(value: out value, script: script) == true);
 }
コード例 #13
0
 /// <summary>
 ///
 /// </summary>
 public static SciterValue EvalScript(this SciterHost host, string script)
 {
     return(host?.EvalScriptInternal(script: script));
 }
コード例 #14
0
 /// <summary>
 /// Detaches the event-handler previously attached with AttachEvh()
 /// </summary>
 public static bool TryDetachEventHandler(this SciterHost host)
 {
     return(host?.TryDetachEventHandlerInternal() == true);
 }
コード例 #15
0
 public static SciterHost RegisterBehaviorHandler <THandler>(this SciterHost host, Func <THandler> eventHandlerFunc, string behaviorName = null)
     where THandler : SciterEventHandler
 {
     host.RegisterBehaviorHandlerInternal <THandler>(eventHandlerFunc: eventHandlerFunc, behaviorName: behaviorName);
     return(host);
 }
コード例 #16
0
 /// <summary>
 ///
 /// </summary>
 public static SciterValue CallFunction(this SciterHost host, string functionName, params SciterValue[] args)
 {
     return(host?.CallFunctionInternal(functionName: functionName, args: args));
 }
コード例 #17
0
 public static SciterHost ConnectToInspector(this SciterHost host)
 {
     return(host?.ConnectToInspectorAsync().ConfigureAwait(false).GetAwaiter().GetResult());
 }
コード例 #18
0
 public SciterEventHandler(SciterHost host = null, string name = null)
 {
     EventProc = EventProcMethod;
     Host      = host;
     Name      = name ?? this.GetType().FullName;
 }
コード例 #19
0
 public HostCallbackWrapper(SciterHost sciterHost)
 {
     _sciterHost       = sciterHost;
     _callbackDelegate = NotificationHandler;
 }