diff options
author | iain <iaholmes@microsoft.com> | 2021-06-02 12:46:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-02 12:46:23 +0300 |
commit | 32bac30b6187bfea96711cd924fcf32e40f08937 (patch) | |
tree | fc571365a0ffb7c4b6972b9e44a313317c404ebb | |
parent | b7d4d9f9594e30955449c4be493af65e7623c729 (diff) | |
parent | 48be76525e94662f0e5c9eca6b35e138443e35d9 (diff) |
Merge pull request #1056 from mono/dev/iain/exit-user-code-as-guest
[Xwt] Exit user code when initialising as guest
-rw-r--r-- | Xwt/Xwt/Application.cs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Xwt/Xwt/Application.cs b/Xwt/Xwt/Application.cs index 649a517e..848a7914 100644 --- a/Xwt/Xwt/Application.cs +++ b/Xwt/Xwt/Application.cs @@ -122,7 +122,7 @@ namespace Xwt toolkit.EnterUserCode (); } - + /// <summary> /// Initializes Xwt as guest, embedded into an other existing toolkit. /// </summary> @@ -145,6 +145,20 @@ namespace Xwt toolkit.ExitUserCode (null); } + public static void InitializeAsGuest(ToolkitType type, bool initializeToolkit) + { + InitializeAsGuest(Toolkit.GetBackendType(type), initializeToolkit); + toolkit.Type = type; + } + + public static void InitializeAsGuest(string backendType, bool initializeToolkit) + { + if (backendType == null) + throw new ArgumentNullException("backendType"); + Initialize(backendType, initializeToolkit); + toolkit.ExitUserCode(null); + } + /// <summary> /// Runs the main Xwt GUI thread. /// </summary> |