protected override void OnCreate() { base.OnCreate(); tlog.Debug(tag, "OnCreate() START!"); mainPid = Process.GetCurrentProcess().Id; mainTid = Thread.CurrentThread.ManagedThreadId; window = NUIApplication.GetDefaultWindow(); window.BackgroundColor = Color.Green; root = new View() { Size = new Size(100, 100), BackgroundColor = Color.White, PositionUsesPivotPoint = true, ParentOrigin = ParentOrigin.Center, PivotPoint = PivotPoint.Center, }; layer = window.GetDefaultLayer(); layer.Add(root); mainTitle = new TextLabel() { MultiLine = true, Text = title + $"Process ID: {Process.GetCurrentProcess().Id} \nThread ID: {Thread.CurrentThread.ManagedThreadId}\n", PixelSize = textSize, BackgroundColor = Color.Cyan, Size = new Size(window.WindowSize.Width * 0.9f, window.WindowSize.Height * 0.9f, 0), PositionUsesPivotPoint = true, ParentOrigin = ParentOrigin.Center, PivotPoint = PivotPoint.Center, }; root.Add(mainTitle); Thread.CurrentThread.Name = "main"; trunner = new NUnitLite.TUnit.TRunner(); trunner.LoadTestsuite(); asyncThreadMgr = TAsyncThreadMgr.GetInstance(); methodExecutionResetEvent = asyncThreadMgr.GetMethodExecutionResetEvent(); methodExecutionResetEvent.Reset(); Task t = Task.Run(() => { Thread.CurrentThread.Name = "textRunner"; trunner._textRunner.Execute(trunner.args); asyncThreadMgr.SetData(null, null, null, null, false); methodExecutionResetEvent.Set(); }); eventThreadCallback = new EventThreadCallback(new EventThreadCallback.CallbackDelegate(ProcessTest)); eventThreadCallback.Trigger(); }
public EventThread(EventThreadCallback callback) { this.callback = callback; thread = new Thread(new ThreadStart(StartThread)); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(EventThreadCallback obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }