Newer
Older
HoloAnatomy / Assets / HoloToolkit / Sharing / Scripts / SDK / Session.cs
SURFACEBOOK2\jackwynne on 25 May 2018 3 KB v1
//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 3.0.10
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------

namespace HoloToolkit.Sharing {

public class Session : global::System.IDisposable {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
  protected bool swigCMemOwn;

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

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

  ~Session() {
    Dispose();
  }

  public virtual void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_Session(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
    }
  }

  public virtual MachineSessionState GetMachineSessionState() {
    MachineSessionState ret = (MachineSessionState)SharingClientPINVOKE.Session_GetMachineSessionState(swigCPtr);
    return ret;
  }

  public virtual void AddListener(SessionListener newListener) {
    SharingClientPINVOKE.Session_AddListener(swigCPtr, SessionListener.getCPtr(newListener));
  }

  public virtual void RemoveListener(SessionListener oldListener) {
    SharingClientPINVOKE.Session_RemoveListener(swigCPtr, SessionListener.getCPtr(oldListener));
  }

  public virtual bool IsJoined() {
    bool ret = SharingClientPINVOKE.Session_IsJoined(swigCPtr);
    return ret;
  }

  public virtual bool Join() {
    bool ret = SharingClientPINVOKE.Session_Join(swigCPtr);
    return ret;
  }

  public virtual void Leave() {
    SharingClientPINVOKE.Session_Leave(swigCPtr);
  }

  public virtual int GetUserCount() {
    int ret = SharingClientPINVOKE.Session_GetUserCount(swigCPtr);
    return ret;
  }

  public virtual User GetUser(int i) {
    global::System.IntPtr cPtr = SharingClientPINVOKE.Session_GetUser(swigCPtr, i);
    User ret = (cPtr == global::System.IntPtr.Zero) ? null : new User(cPtr, true);
    return ret; 
  }

  public virtual SessionType GetSessionType() {
    SessionType ret = (SessionType)SharingClientPINVOKE.Session_GetSessionType(swigCPtr);
    return ret;
  }

  public virtual XString GetName() {
    global::System.IntPtr cPtr = SharingClientPINVOKE.Session_GetName(swigCPtr);
    XString ret = (cPtr == global::System.IntPtr.Zero) ? null : new XString(cPtr, true);
    return ret; 
  }

  public virtual NetworkConnection GetSessionNetworkConnection() {
    global::System.IntPtr cPtr = SharingClientPINVOKE.Session_GetSessionNetworkConnection(swigCPtr);
    NetworkConnection ret = (cPtr == global::System.IntPtr.Zero) ? null : new NetworkConnection(cPtr, true);
    return ret; 
  }

}

}