示例#1
0
 static Point TranslateCoordinates(Xwt.Toolkit sourceToolkit, Xwt.Toolkit targetToolkit, Point point)
 {
     if (sourceToolkit == targetToolkit)
     {
         return(point);
     }
     sourceToolkit.Invoke(() => {
         var desktopBounds = Desktop.Bounds;
         point.X          -= desktopBounds.X;
         point.Y          -= desktopBounds.Y;
     });
     targetToolkit.Invoke(() => {
         var desktopBounds = Desktop.Bounds;
         point.X          += desktopBounds.X;
         point.Y          += desktopBounds.Y;
     });
     return(point);
 }
示例#2
0
 public static void Exit()
 {
     Toolkit.InvokePlatformCode(delegate {
         engine.ExitApplication();
     });
 }
示例#3
0
 internal void SetActive()
 {
     currentEngine = this;
 }
示例#4
0
 public static void Run()
 {
     Toolkit.InvokePlatformCode(delegate {
         engine.RunApplication();
     });
 }
示例#5
0
 internal UILoop(Toolkit toolkit)
 {
     this.toolkit = toolkit;
 }
示例#6
0
 /// <summary>
 /// Initialize Xwt with the specified type.
 /// </summary>
 /// <param name="type">The toolkit type.</param>
 public static void Initialize(ToolkitType type)
 {
     Initialize(Toolkit.GetBackendType(type));
     toolkit.Type = type;
 }
示例#7
0
 /// <summary>
 /// Releases all resources used by the application
 /// </summary>
 /// <remarks>This method must be called before the application process ends</remarks>
 public static void Dispose()
 {
     ResourceManager.Dispose();
     Toolkit.DisposeAll();
 }
示例#8
0
 internal Screen(object backend, Toolkit toolkit) : base(backend, toolkit)
 {
 }
示例#9
0
 public void SetActive()
 {
     currentEngine = this;
 }
示例#10
0
文件: XwtObject.cs 项目: wesreid/xwt
 protected XwtObject()
 {
     ToolkitEngine = Toolkit.CurrentEngine;
 }
示例#11
0
文件: XwtObject.cs 项目: wesreid/xwt
 protected XwtObject(object backend, Toolkit toolkit)
 {
     this.backend  = backend;
     ToolkitEngine = Toolkit.CurrentEngine;
 }