コード例 #1
0
 internal static void Remove(SciterWindow window)
 {
     if (Registry.ContainsKey(window))
     {
         Registry.TryRemove(window, out var @delegate);
     }
 }
コード例 #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);
        }
コード例 #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);
 }
コード例 #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));
 }
コード例 #5
0
 public static bool TryGetRootElement(this SciterWindow window, out SciterElement element)
 {
     element = default(SciterElement);
     return(window?.TryGetRootElementInternal(out element) == true);
 }
コード例 #6
0
ファイル: MessageBox.cs プロジェクト: wdcossey/SciterCore
 /// <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);
 }
コード例 #7
0
 public static int GetMinWidth(this SciterWindow window)
 {
     return(window?.GetMinWidthInternal() ?? default(int));
 }
コード例 #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));
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #12
0
 public static string GetTitle(this SciterWindow window)
 {
     return(window.GetTitleInternal());
 }
コード例 #13
0
 public static bool TryUpdateWindow(this SciterWindow window)
 {
     return(window?.TryUpdateWindowInternal() == true);
 }
コード例 #14
0
 public static SciterWindow UpdateWindow(this SciterWindow window)
 {
     window?.UpdateWindowInternal();
     return(window);
 }
コード例 #15
0
 public static int GetMinHeight(this SciterWindow window, int width)
 {
     return(window?.GetMinHeightInternal(width) ?? default(int));
 }
コード例 #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);
 }
コード例 #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));
 }
コード例 #18
0
 public static SciterWindow SetTitle(this SciterWindow window, string title)
 {
     window.SetTitleInternal(title);
     return(window);
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #21
0
 internal static SciterXDef.SCITER_WINDOW_DELEGATE Get(SciterWindow window)
 {
     return(Registry.TryGetValue(window, out var result) ? result : null);
 }
コード例 #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);
 }
コード例 #23
0
 public static SciterElement GetRootElement(this SciterWindow window)
 {
     return(window?.GetRootElementInternal());
 }
コード例 #24
0
 public static THost CreateHost <THost>(this SciterWindow window)
     where THost : SciterHost, new()
 {
     return((THost)Activator.CreateInstance(type: typeof(THost), new object[] { window }));
 }