using System.Runtime.InteropServices;
using Decal.Interop.Filters;
using Decal.Interop.Net;

namespace Decal.DecalFilters
{
    [ComVisible(true)]
    [Guid("443D4A68-5422-4E0C-9460-973F8FBDB190")]
    [ClassInterface(ClassInterfaceType.None)]
    [ComSourceInterfaces("Decal.Interop.Filters.IPrefilterEvents\0\0")]
    [ProgId("DecalFilters.Prefilter")]
    public class PrefilterImpl : IPrefilter, INetworkFilter2
    {
        public event IPrefilterEvents_EventEventHandler Event;

        // IPrefilter is empty

        public void Initialize(NetService pService) { }
        public void Terminate() { }

        public void DispatchServer(IMessage2 Message)
        {
            Event?.Invoke(Message.Type, (IMessage)Message);
        }

        public void DispatchClient(IMessage2 Message)
        {
            Event?.Invoke(Message.Type, (IMessage)Message);
        }
    }
}
