using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel.Dispatcher;

namespace DemoServicesExtensions
{
    public class MyCustomFilter : MessageFilter
    {
        private string _matchData;
        public MyCustomFilter(string matchData)
        {
            this._matchData = matchData;
            Console.WriteLine("MyCustomFilter constructor, {0}", matchData);
        }

        public override bool Match(System.ServiceModel.Channels.Message message)
        {
            Console.WriteLine("Message match {0}",message.Headers.Action);
            return true;
        }

        public override bool Match(System.ServiceModel.Channels.MessageBuffer buffer)
        {
            Console.WriteLine("Buffer match {0}", buffer.MessageContentType);
            return true;
        }
    }
}
