internal static void Remove(SciterWindow window) { if (Registry.ContainsKey(window)) { Registry.TryRemove(window, out var @delegate); } }
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); }
/// <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); }
/// <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)); }
public static bool TryGetRootElement(this SciterWindow window, out SciterElement element) { element = default(SciterElement); return(window?.TryGetRootElementInternal(out element) == true); }
/// <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); }
public static int GetMinWidth(this SciterWindow window) { return(window?.GetMinWidthInternal() ?? default(int)); }
/// <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)); }
/// <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); }
/// <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); }
/// <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); }
public static string GetTitle(this SciterWindow window) { return(window.GetTitleInternal()); }
public static bool TryUpdateWindow(this SciterWindow window) { return(window?.TryUpdateWindowInternal() == true); }
public static SciterWindow UpdateWindow(this SciterWindow window) { window?.UpdateWindowInternal(); return(window); }
public static int GetMinHeight(this SciterWindow window, int width) { return(window?.GetMinHeightInternal(width) ?? default(int)); }
/// <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); }
/// <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)); }
public static SciterWindow SetTitle(this SciterWindow window, string title) { window.SetTitleInternal(title); return(window); }
/// <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); }
/// <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); }
internal static SciterXDef.SCITER_WINDOW_DELEGATE Get(SciterWindow window) { return(Registry.TryGetValue(window, out var result) ? result : null); }
/// <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); }
public static SciterElement GetRootElement(this SciterWindow window) { return(window?.GetRootElementInternal()); }
public static THost CreateHost <THost>(this SciterWindow window) where THost : SciterHost, new() { return((THost)Activator.CreateInstance(type: typeof(THost), new object[] { window })); }