Example #1
0
 internal static void Remove(SciterWindow window)
 {
     if (Registry.ContainsKey(window))
     {
         Registry.TryRemove(window, out var @delegate);
     }
 }
Example #2
0
        internal static SciterXDef.SCITER_WINDOW_DELEGATE Set(SciterWindow window,
                                                              SciterXDef.SCITER_WINDOW_DELEGATE @delegate)
        {
            if (Registry.ContainsKey(window))
            {
                return(Get(window));
            }

            Registry.TryAdd(window, @delegate);

            return(@delegate);
        }
Example #3
0
 /// <summary>
 /// Find element at point x/y of the window, client area relative
 /// </summary>
 public static bool TryGetElementAtPoint(this SciterWindow window, out SciterElement element, int x, int y)
 {
     element = default(SciterElement);
     return(window?.TryGetElementAtPointInternal(value: out element, x: x, y: y) == true);
 }
Example #4
0
 /// <summary>
 /// Find element at point x/y of the window, client area relative
 /// </summary>
 public static SciterElement GetElementAtPoint(this SciterWindow window, int x, int y)
 {
     return(window?.GetElementAtPointInternal(x: x, y: y));
 }
Example #5
0
 public static bool TryGetRootElement(this SciterWindow window, out SciterElement element)
 {
     element = default(SciterElement);
     return(window?.TryGetRootElementInternal(out element) == true);
 }
Example #6
0
 /// <summary>
 /// Show a system message-box owned by this Sciter window. If caption is null, it will be the title of the Sciter window
 /// </summary>
 /// <param name="window"></param>
 /// <param name="text"></param>
 /// <param name="caption"></param>
 public static void ShowMessageBox(this SciterWindow window, string text, string caption = null)
 {
     Show(owner: window.Handle, text: text, caption: caption ?? window.Title);
 }
Example #7
0
 public static int GetMinWidth(this SciterWindow window)
 {
     return(window?.GetMinWidthInternal() ?? default(int));
 }
Example #8
0
 /// <summary>
 /// Searches this window DOM tree for element with the given UID
 /// </summary>
 /// <returns>The element, or null if it doesn't exists</returns>
 public static SciterElement GetElementByUid(this SciterWindow window, uint uid)
 {
     return(window?.GetElementByUidInternal(uid: uid));
 }
Example #9
0
 /// <summary>
 /// Loads HTML input from a string
 /// </summary>
 /// <param name="window"></param>
 /// <param name="html">HTML of the page to be loaded</param>
 /// <param name="baseUrl">Base Url given to the loaded page</param>
 public static SciterWindow LoadHtml(this SciterWindow window, string html, string baseUrl = null)
 {
     window?.LoadHtmlInternal(html: html, baseUrl: baseUrl);
     return(window);
 }
Example #10
0
 /// <summary>
 /// Loads the page resource from the given URL or file path
 /// </summary>
 /// <param name="window"></param>
 /// <param name="uri">URL or file path of the page</param>
 public static bool TryLoadPage(this SciterWindow window, Uri uri)
 {
     return(window?.TryLoadPageInternal(uri: uri) == true);
 }
Example #11
0
 /// <summary>
 /// Loads the page resource from the given URL or file path
 /// </summary>
 /// <param name="window"></param>
 /// <param name="uri">URL or file path of the page</param>
 public static SciterWindow LoadPage(this SciterWindow window, Uri uri)
 {
     window?.LoadPageInternal(uri: uri);
     return(window);
 }
Example #12
0
 public static string GetTitle(this SciterWindow window)
 {
     return(window.GetTitleInternal());
 }
Example #13
0
 public static bool TryUpdateWindow(this SciterWindow window)
 {
     return(window?.TryUpdateWindowInternal() == true);
 }
Example #14
0
 public static SciterWindow UpdateWindow(this SciterWindow window)
 {
     window?.UpdateWindowInternal();
     return(window);
 }
Example #15
0
 public static int GetMinHeight(this SciterWindow window, int width)
 {
     return(window?.GetMinHeightInternal(width) ?? default(int));
 }
Example #16
0
 /// <summary>
 /// Find element at the <see cref="SciterPoint"/> of the window, client area relative
 /// </summary>
 public static bool TryGetElementAtPoint(this SciterWindow window, out SciterElement element, SciterPoint point)
 {
     element = default(SciterElement);
     return(window?.TryGetElementAtPointInternal(value: out element, point: point) == true);
 }
Example #17
0
 /// <summary>
 /// Find element at the <see cref="SciterPoint"/> of the window, client area relative
 /// </summary>
 public static SciterElement GetElementAtPoint(this SciterWindow window, SciterPoint point)
 {
     return(window?.GetElementAtPointInternal(point: point));
 }
Example #18
0
 public static SciterWindow SetTitle(this SciterWindow window, string title)
 {
     window.SetTitleInternal(title);
     return(window);
 }
Example #19
0
 /// <summary>
 /// Searches this window DOM tree for element with the given UID
 /// </summary>
 /// <returns>The element, or null if it doesn't exists</returns>
 public static bool TryGetElementByUid(this SciterWindow window, out SciterElement element, uint uid)
 {
     element = default(SciterElement);
     return(window?.TryGetElementByUidInternal(value: out element, uid: uid) == true);
 }
Example #20
0
 /// <summary>
 /// Loads HTML input from a string
 /// </summary>
 /// <param name="window"></param>
 /// <param name="html">HTML of the page to be loaded</param>
 /// <param name="baseUrl">Base Url given to the loaded page</param>
 public static SciterWindow LoadHtml(this SciterWindow window, Func <string> html, string baseUrl = null)
 {
     window?.LoadHtmlInternal(html: html?.Invoke(), baseUrl: baseUrl);
     return(window);
 }
Example #21
0
 internal static SciterXDef.SCITER_WINDOW_DELEGATE Get(SciterWindow window)
 {
     return(Registry.TryGetValue(window, out var result) ? result : null);
 }
Example #22
0
 /// <summary>
 /// Loads HTML input from a string
 /// </summary>
 /// <param name="window"></param>
 /// <param name="html">HTML of the page to be loaded</param>
 /// <param name="baseUrl">Base Url given to the loaded page</param>
 public static bool TryLoadHtml(this SciterWindow window, Func <string> html, string baseUrl = null)
 {
     return(window?.TryLoadHtmlInternal(html: html?.Invoke(), baseUrl: baseUrl) == true);
 }
Example #23
0
 public static SciterElement GetRootElement(this SciterWindow window)
 {
     return(window?.GetRootElementInternal());
 }
Example #24
0
 public static THost CreateHost <THost>(this SciterWindow window)
     where THost : SciterHost, new()
 {
     return((THost)Activator.CreateInstance(type: typeof(THost), new object[] { window }));
 }