FileListProgress.cs 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.1
  4. *
  5. * Do not make changes to this file unless you know what you are doing--modify
  6. * the SWIG interface file instead.
  7. * ----------------------------------------------------------------------------- */
  8. namespace RakNet {
  9. using System;
  10. using System.Runtime.InteropServices;
  11. public class FileListProgress : IDisposable {
  12. private HandleRef swigCPtr;
  13. protected bool swigCMemOwn;
  14. internal FileListProgress(IntPtr cPtr, bool cMemoryOwn) {
  15. swigCMemOwn = cMemoryOwn;
  16. swigCPtr = new HandleRef(this, cPtr);
  17. }
  18. internal static HandleRef getCPtr(FileListProgress obj) {
  19. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  20. }
  21. ~FileListProgress() {
  22. Dispose();
  23. }
  24. public virtual void Dispose() {
  25. lock(this) {
  26. if (swigCPtr.Handle != IntPtr.Zero) {
  27. if (swigCMemOwn) {
  28. swigCMemOwn = false;
  29. RakNetPINVOKE.delete_FileListProgress(swigCPtr);
  30. }
  31. swigCPtr = new HandleRef(null, IntPtr.Zero);
  32. }
  33. GC.SuppressFinalize(this);
  34. }
  35. }
  36. public static FileListProgress GetInstance() {
  37. IntPtr cPtr = RakNetPINVOKE.FileListProgress_GetInstance();
  38. FileListProgress ret = (cPtr == IntPtr.Zero) ? null : new FileListProgress(cPtr, false);
  39. return ret;
  40. }
  41. public static void DestroyInstance(FileListProgress i) {
  42. RakNetPINVOKE.FileListProgress_DestroyInstance(FileListProgress.getCPtr(i));
  43. }
  44. public FileListProgress() : this(RakNetPINVOKE.new_FileListProgress(), true) {
  45. }
  46. public virtual void OnAddFilesFromDirectoryStarted(FileList fileList, string dir) {
  47. RakNetPINVOKE.FileListProgress_OnAddFilesFromDirectoryStarted(swigCPtr, FileList.getCPtr(fileList), dir);
  48. }
  49. public virtual void OnDirectory(FileList fileList, string dir, uint directoriesRemaining) {
  50. RakNetPINVOKE.FileListProgress_OnDirectory(swigCPtr, FileList.getCPtr(fileList), dir, directoriesRemaining);
  51. }
  52. public virtual void OnFile(FileList fileList, string dir, string fileName, uint fileSize) {
  53. RakNetPINVOKE.FileListProgress_OnFile(swigCPtr, FileList.getCPtr(fileList), dir, fileName, fileSize);
  54. }
  55. public virtual void OnFilePush(string fileName, uint fileLengthBytes, uint offset, uint bytesBeingSent, bool done, SystemAddress targetSystem, ushort setId) {
  56. RakNetPINVOKE.FileListProgress_OnFilePush(swigCPtr, fileName, fileLengthBytes, offset, bytesBeingSent, done, SystemAddress.getCPtr(targetSystem), setId);
  57. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  58. }
  59. public virtual void OnFilePushesComplete(SystemAddress systemAddress, ushort setId) {
  60. RakNetPINVOKE.FileListProgress_OnFilePushesComplete(swigCPtr, SystemAddress.getCPtr(systemAddress), setId);
  61. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  62. }
  63. public virtual void OnSendAborted(SystemAddress systemAddress) {
  64. RakNetPINVOKE.FileListProgress_OnSendAborted(swigCPtr, SystemAddress.getCPtr(systemAddress));
  65. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  66. }
  67. }
  68. }
粤ICP备19079148号