/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.7
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

namespace cAudio {

using System;
using System.Runtime.InteropServices;

public class ILogReceiver : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

  internal ILogReceiver(IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = new HandleRef(this, cPtr);
  }

  internal static HandleRef getCPtr(ILogReceiver obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }

  ~ILogReceiver() {
    Dispose();
  }

  public virtual void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          cAudioCSharpWrapperPINVOKE.delete_ILogReceiver(swigCPtr);
        }
        swigCPtr = new HandleRef(null, IntPtr.Zero);
      }
      GC.SuppressFinalize(this);
    }
  }

  public ILogReceiver() : this(cAudioCSharpWrapperPINVOKE.new_ILogReceiver(), true) {
    SwigDirectorConnect();
  }

  public virtual bool OnLogMessage(string sender, string message, LogLevel level, float time) {
    bool ret = cAudioCSharpWrapperPINVOKE.ILogReceiver_OnLogMessage(swigCPtr, sender, message, (int)level, time);
    return ret;
  }

  private void SwigDirectorConnect() {
    if (SwigDerivedClassHasMethod("OnLogMessage", swigMethodTypes0))
      swigDelegate0 = new SwigDelegateILogReceiver_0(SwigDirectorOnLogMessage);
    cAudioCSharpWrapperPINVOKE.ILogReceiver_director_connect(swigCPtr, swigDelegate0);
  }

  private bool SwigDerivedClassHasMethod(string methodName, Type[] methodTypes) {
    System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance, null, methodTypes, null);
    bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(ILogReceiver));
    return hasDerivedMethod;
  }

  private bool SwigDirectorOnLogMessage(string sender, string message, int level, float time) {
    return OnLogMessage(sender, message, (LogLevel)level, time);
  }

  public delegate bool SwigDelegateILogReceiver_0(string sender, string message, int level, float time);

  private SwigDelegateILogReceiver_0 swigDelegate0;

  private static Type[] swigMethodTypes0 = new Type[] { typeof(string), typeof(string), typeof(LogLevel), typeof(float) };
}

}
