Beispiel #1
0
        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)");
        }
Beispiel #2
0
        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)");
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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)");
        }
Beispiel #6
0
        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)");
        }