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); }
public void FloatSignalConnect() { tlog.Debug(tag, $"FloatSignalConnect START"); var testingTarget = new FloatSignal(); Assert.IsNotNull(testingTarget, "Should be not null!"); Assert.IsInstanceOf <FloatSignal>(testingTarget, "Should be an Instance of FloatSignal!"); 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, $"FloatSignalConnect END (OK)"); }