PageRenderTime 40ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/Multimedia/Vlc/LibVlc/VlcException.cs

#
C# | 45 lines | 31 code | 5 blank | 9 comment | 1 complexity | e1c07d2828f1b4d3a002c4c2f6dc8def MD5 | raw file
Possible License(s): Apache-2.0
  1. using System;
  2. using System.Runtime.InteropServices;
  3. namespace Delta.Multimedia.Vlc.LibVlc
  4. {
  5. internal class VlcException : Exception
  6. {
  7. #region Message (Public)
  8. /// <summary>
  9. /// The error message of the exception.
  10. /// </summary>
  11. public override string Message
  12. {
  13. get
  14. {
  15. return errorMessage;
  16. }
  17. }
  18. #endregion
  19. #region Private
  20. #region errorMessage (Private)
  21. /// <summary>
  22. /// The error message of the exception.
  23. /// </summary>
  24. private readonly string errorMessage;
  25. #endregion
  26. #endregion
  27. #region Constructors
  28. /// <summary>
  29. /// Create a new vlc exception.
  30. /// </summary>
  31. public VlcException()
  32. {
  33. IntPtr errorPointer = VlcCore.libvlc_errmsg();
  34. errorMessage = errorPointer == IntPtr.Zero
  35. ? "VLC Exception"
  36. : Marshal.PtrToStringAuto(errorPointer);
  37. }
  38. #endregion
  39. }
  40. }