public void VoidSignalEmit() { tlog.Debug(tag, $"VoidSignalEmit START"); var currentPid = global::System.Diagnostics.Process.GetCurrentProcess().Id; var currentTid = global::System.Threading.Thread.CurrentThread.ManagedThreadId; tlog.Debug(tag, $"thread check! main pid={App.mainPid}, current pid={currentPid}, main tid={App.mainTid}, current tid={currentTid}"); using (View view = new View()) { var testingTarget = new VoidSignal(); Assert.IsNotNull(testingTarget, "Should be not null!"); Assert.IsInstanceOf <VoidSignal>(testingTarget, "Should be an Instance of VoidSignal!"); try { testingTarget.Emit(); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception: Failed!"); } testingTarget.Dispose(); } tlog.Debug(tag, $"VoidSignalEmit END (OK)"); }
public void VoidSignalConnect() { tlog.Debug(tag, $"VoidSignalConnect START"); var testingTarget = new VoidSignal(); Assert.IsNotNull(testingTarget, "Should be not null!"); Assert.IsInstanceOf <VoidSignal>(testingTarget, "Should be an Instance of VoidSignal!"); try { dummyCallback callback = OnDummyCallback; testingTarget.Connect(callback); testingTarget.Disconnect(callback); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception: Failed!"); } testingTarget.Dispose(); tlog.Debug(tag, $"VoidSignalConnect END (OK)"); }
protected override void Dispose(DisposeTypes type) { if (disposed) { return; } //Release your own unmanaged resources here. //You should not access any managed member here except static instance. //because the execution order of Finalizes is non-deterministic. if (this != null) { if (_scrollBarScrollPositionIntervalReachedEventCallbackDelegate != null) { FloatSignal scrollPositionIntervalReached = ScrollPositionIntervalReachedSignal(); scrollPositionIntervalReached?.Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate); scrollPositionIntervalReached?.Dispose(); } if (_scrollBarPanFinishedEventCallbackDelegate != null) { VoidSignal panFinished = PanFinishedSignal(); panFinished?.Disconnect(_scrollBarPanFinishedEventCallbackDelegate); panFinished?.Dispose(); } } base.Dispose(type); }
protected override void Dispose(DisposeTypes type) { if (disposed) { return; } //Release your own unmanaged resources here. //You should not access any managed member here except static instance. //because the execution order of Finalizes is non-deterministic. if (this != null) { if (_popUpHiddenEventCallbackDelegate != null) { VoidSignal hiddenSignal = HiddenSignal(); hiddenSignal?.Disconnect(_popUpHiddenEventCallbackDelegate); hiddenSignal?.Dispose(); } if (_popUpHidingEventCallbackDelegate != null) { VoidSignal hidingSignal = HidingSignal(); hidingSignal?.Disconnect(_popUpHidingEventCallbackDelegate); hidingSignal?.Dispose(); } } if (_popUpShownEventCallbackDelegate != null) { VoidSignal shownSignal = ShownSignal(); shownSignal?.Disconnect(_popUpShownEventCallbackDelegate); shownSignal?.Dispose(); } if (_popUpShowingEventCallbackDelegate != null) { VoidSignal showingSignal = ShowingSignal(); showingSignal?.Disconnect(_popUpShowingEventCallbackDelegate); showingSignal?.Dispose(); } if (_popUpOutsideTouchedEventCallbackDelegate != null) { VoidSignal outsideTouchedSingal = this.OutsideTouchedSignal(); outsideTouchedSingal?.Disconnect(_popUpOutsideTouchedEventCallbackDelegate); outsideTouchedSingal?.Dispose(); } base.Dispose(type); }
public void VoidSignalConstructor() { tlog.Debug(tag, $"VoidSignalConstructor START"); using (View view = new View()) { var testingTarget = new VoidSignal(view.SwigCPtr.Handle, false); Assert.IsNotNull(testingTarget, "Should be not null!"); Assert.IsInstanceOf <VoidSignal>(testingTarget, "Should be an Instance of VoidSignal!"); testingTarget.Dispose(); } tlog.Debug(tag, $"VoidSignalConstructor END (OK)"); }
public void VoidSignalGetConnectionCount() { tlog.Debug(tag, $"VoidSignalGetConnectionCount START"); var testingTarget = new VoidSignal(); Assert.IsNotNull(testingTarget, "Should be not null!"); Assert.IsInstanceOf <VoidSignal>(testingTarget, "Should be an Instance of VoidSignal!"); try { testingTarget.GetConnectionCount(); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception: Failed!"); } testingTarget.Dispose(); tlog.Debug(tag, $"VoidSignalGetConnectionCount END (OK)"); }