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

            helper.MakeAwareOf(trigger);
        }
Пример #2
0
        /// <summary>
        /// Makes the filter aware of the <see cref="IMessageTrigger"/>.
        /// </summary>
        /// <param name="messageHandler">The message handler.</param>
        /// <param name="trigger">The trigger.</param>
        public void MakeAwareOf(IRoutedMessageHandler messageHandler, IMessageTrigger trigger)
        {
            var helper = messageHandler.GetMetadata<DependencyObserver>();
            if (helper == null) return;

            if (trigger.Message.RelatesTo(_target))
                helper.MakeAwareOf(trigger, _dependencies);
        }
        /// <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="IMessageTrigger"/>.
        /// </summary>
        /// <param name="messageHandler">The message handler.</param>
        /// <param name="trigger">The trigger.</param>
        public void MakeAwareOf(IRoutedMessageHandler messageHandler, IMessageTrigger trigger)
        {
            var helper = messageHandler.GetMetadata <AutoCheckAvailabilityHelper>();

            if (helper == null)
            {
                return;
            }

            helper.MakeAwareOf(trigger);
        }
Пример #5
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);
        }
Пример #6
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);
        }
Пример #7
0
        /// <summary>
        /// Makes the filter aware of the <see cref="IMessageTrigger"/>.
        /// </summary>
        /// <param name="messageHandler">The message handler.</param>
        /// <param name="trigger">The trigger.</param>
        public void MakeAwareOf(IRoutedMessageHandler messageHandler, IMessageTrigger trigger)
        {
            var helper = messageHandler.GetMetadata <ItemDependencyObserver>();

            if (helper == null)
            {
                return;
            }

            if (trigger.Message.RelatesTo(_target))
            {
                helper.MakeAwareOf(trigger, _dependencies);
            }
        }
Пример #8
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);
        }
Пример #9
0
        /// <summary>
        /// Makes the filter aware of the <see cref="IMessageTrigger"/>.
        /// </summary>
        /// <param name="messageHandler">The message handler.</param>
        /// <param name="trigger">The trigger.</param>
        public void MakeAwareOf(IRoutedMessageHandler messageHandler, IMessageTrigger trigger)
        {
            if (!AffectsTriggers || !IsGetter)
            {
                return;
            }

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

            if (helper == null)
            {
                return;
            }

            if (trigger.Message.RelatesTo(Target))
            {
                helper.MakeAwareOf(trigger, new[] { MethodName });
            }
        }
Пример #10
0
        /// <summary>
        /// Makes the filter aware of the <see cref="IMessageTrigger"/>.
        /// </summary>
        /// <param name="messageHandler">The message handler.</param>
        /// <param name="trigger">The trigger.</param>
        public void MakeAwareOf(IRoutedMessageHandler messageHandler, IMessageTrigger trigger)
        {
            if (!AffectsTriggers || !IsGetter)
                return;

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

            if (trigger.Message.RelatesTo(Target))
                helper.MakeAwareOf(trigger, new[] { MethodName });
        }