示例#1
0
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("BackgroundFader::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.InvokeInUIThread(() =>
            {
                WPFDoEvents.SafeExec(() =>
                {
                    if (dispose_count == 0)
                    {
                        // Get rid of managed resources / get rid of cyclic references:
                        if (null != control)
                        {
                            control.MouseEnter -= DocumentNodeContentControl_MouseEnter;
                            control.MouseLeave -= DocumentNodeContentControl_MouseLeave;
                        }
                    }
                });

                WPFDoEvents.SafeExec(() =>
                {
                    control = null;
                });

                ++dispose_count;
            });
        }
示例#2
0
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("AugmentedPopupAutoCloser::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.InvokeInUIThread(() =>
            {
                WPFDoEvents.SafeExec(() =>
                {
                    if (dispose_count == 0)
                    {
                        // Get rid of managed resources
                        if (popup != null)
                        {
                            popup.IsOpen = false;
                        }
                    }
                });

                WPFDoEvents.SafeExec(() =>
                {
                    popup = null;
                });

                ++dispose_count;
            });
        }
示例#3
0
        internal /*virtual*/ void Dispose(bool disposing)    // sealed class doesn't allow 'virtual' + warning CS0628: 'WeakDependencyPropertyChangeNotifier.Dispose(bool)': new protected member declared in sealed class
        {
            Logging.Debug("WeakDependencyPropertyChangeNotifier::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.SafeExec(() =>
            {
                if (dispose_count == 0)
                {
                    BindingOperations.ClearBinding(this, ValueProperty);
                }
            }, must_exec_in_UI_thread: true);

            WPFDoEvents.SafeExec(() =>
            {
                _propertySource = null;
            });

            ++dispose_count;
        }