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

namespace com.taptap.tapsdk.bindings.csharp {

public class TDSUser : global::System.IDisposable {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
  private bool swigCMemOwnBase;

  internal TDSUser(global::System.IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwnBase = cMemoryOwn;
    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
  }

  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TDSUser obj) {
    return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
  }

  ~TDSUser() {
    Dispose(false);
  }

  public void Dispose() {
    Dispose(true);
    global::System.GC.SuppressFinalize(this);
  }

  protected virtual void Dispose(bool disposing) {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwnBase) {
          swigCMemOwnBase = false;
          TapSDKPINVOKE.delete_TDSUser(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
    }
  }

  public static void SetCurrent(TDSUser user) {
    TapSDKPINVOKE.TDSUser_SetCurrent(TDSUser.getCPtr(user));
    if (TapSDKPINVOKE.SWIGPendingException.Pending) throw TapSDKPINVOKE.SWIGPendingException.Retrieve();
  }

  public static TDSUser GetCurrent() {
    global::System.IntPtr cPtr = TapSDKPINVOKE.TDSUser_GetCurrent();
    TDSUser ret = (cPtr == global::System.IntPtr.Zero) ? null : new TDSUser(cPtr, true);
    return ret;
  }

  public TDSUser(string user_id) : this(TapSDKPINVOKE.new_TDSUser__SWIG_0(user_id), true) {
    if (TapSDKPINVOKE.SWIGPendingException.Pending) throw TapSDKPINVOKE.SWIGPendingException.Retrieve();
    SwigDirectorConnect();
  }

  public TDSUser() : this(TapSDKPINVOKE.new_TDSUser__SWIG_1(), true) {
    SwigDirectorConnect();
  }

  public virtual string GetUserId() {
    string ret = (SwigDerivedClassHasMethod("GetUserId", swigMethodTypes0) ? TapSDKPINVOKE.TDSUser_GetUserIdSwigExplicitTDSUser(swigCPtr) : TapSDKPINVOKE.TDSUser_GetUserId(swigCPtr));
    if (TapSDKPINVOKE.SWIGPendingException.Pending) throw TapSDKPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual string GetUserName() {
    string ret = TapSDKPINVOKE.TDSUser_GetUserName(swigCPtr);
    if (TapSDKPINVOKE.SWIGPendingException.Pending) throw TapSDKPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual bool ContainTapInfo() {
    bool ret = TapSDKPINVOKE.TDSUser_ContainTapInfo(swigCPtr);
    if (TapSDKPINVOKE.SWIGPendingException.Pending) throw TapSDKPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  private void SwigDirectorConnect() {
    if (SwigDerivedClassHasMethod("GetUserId", swigMethodTypes0))
      swigDelegate0 = new SwigDelegateTDSUser_0(SwigDirectorMethodGetUserId);
    if (SwigDerivedClassHasMethod("GetUserName", swigMethodTypes1))
      swigDelegate1 = new SwigDelegateTDSUser_1(SwigDirectorMethodGetUserName);
    if (SwigDerivedClassHasMethod("ContainTapInfo", swigMethodTypes2))
      swigDelegate2 = new SwigDelegateTDSUser_2(SwigDirectorMethodContainTapInfo);
    TapSDKPINVOKE.TDSUser_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2);
  }

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

  private string SwigDirectorMethodGetUserId() {
    return GetUserId();
  }

  private string SwigDirectorMethodGetUserName() {
    return GetUserName();
  }

  private bool SwigDirectorMethodContainTapInfo() {
    return ContainTapInfo();
  }

  public delegate string SwigDelegateTDSUser_0();
  public delegate string SwigDelegateTDSUser_1();
  public delegate bool SwigDelegateTDSUser_2();

  private SwigDelegateTDSUser_0 swigDelegate0;
  private SwigDelegateTDSUser_1 swigDelegate1;
  private SwigDelegateTDSUser_2 swigDelegate2;

  private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] {  };
  private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] {  };
  private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] {  };
}

}
