/// <summary>
        /// Makes the filter aware of the <see cref="IRoutedMessageHandler"/>.
        /// </summary>
        /// <param name="messageHandler">The message handler.</param>
        public void MakeAwareOf(IRoutedMessageHandler messageHandler)
        {
            var helper = messageHandler.GetMetadata<AutoCheckAvailabilityHelper>();
            if(helper != null) return;

            helper = new AutoCheckAvailabilityHelper(messageHandler);
            messageHandler.AddMetadata(helper);
        }
Пример #2
0
        /// <summary>
        /// Makes the filter aware of the <see cref="IRoutedMessageHandler"/>.
        /// </summary>
        /// <param name="messageHandler">The message handler.</param>
        public void MakeAwareOf(IRoutedMessageHandler messageHandler)
        {
            var notifier = messageHandler.Unwrap() as INotifyPropertyChanged;
            if (notifier == null) return;

            var helper = messageHandler.GetMetadata<DependencyObserver>();
            if (helper != null) return;

            helper = new DependencyObserver(messageHandler, _methodFactory, notifier);
            messageHandler.AddMetadata(helper);
        }
Пример #3
0
        /// <summary>
        /// Makes the filter aware of the <see cref="IRoutedMessageHandler"/>.
        /// </summary>
        /// <param name="messageHandler">The message handler.</param>
        public void MakeAwareOf(IRoutedMessageHandler messageHandler)
        {
            var helper = messageHandler.GetMetadata <AutoCheckAvailabilityHelper>();

            if (helper != null)
            {
                return;
            }

            helper = new AutoCheckAvailabilityHelper(messageHandler);
            messageHandler.AddMetadata(helper);
        }
Пример #4
0
        /// <summary>
        /// Makes the filter aware of the <see cref="IRoutedMessageHandler"/>.
        /// </summary>
        /// <param name="messageHandler">The message handler.</param>
        public void MakeAwareOf(IRoutedMessageHandler messageHandler)
        {
            var notifier = messageHandler.Unwrap() as INotifyPropertyChanged;

            if (notifier == null)
            {
                return;
            }

            var helper = messageHandler.GetMetadata <ItemDependencyObserver>();

            if (helper != null)
            {
                return;
            }

            helper = new ItemDependencyObserver(messageHandler, _methodFactory, notifier);
            messageHandler.AddMetadata(helper);
        }