/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
- using System;
- using System.Runtime.InteropServices;
-
- namespace Delta.Multimedia.Vlc.LibVlc
- {
- internal class VlcException : Exception
- {
- #region Message (Public)
- /// <summary>
- /// The error message of the exception.
- /// </summary>
- public override string Message
- {
- get
- {
- return errorMessage;
- }
- }
- #endregion
-
- #region Private
-
- #region errorMessage (Private)
- /// <summary>
- /// The error message of the exception.
- /// </summary>
- private readonly string errorMessage;
- #endregion
-
- #endregion
-
- #region Constructors
- /// <summary>
- /// Create a new vlc exception.
- /// </summary>
- public VlcException()
- {
- IntPtr errorPointer = VlcCore.libvlc_errmsg();
- errorMessage = errorPointer == IntPtr.Zero
- ? "VLC Exception"
- : Marshal.PtrToStringAuto(errorPointer);
- }
- #endregion
- }
- }