PageRenderTime 102ms CodeModel.GetById 60ms app.highlight 1ms RepoModel.GetById 39ms app.codeStats 0ms

/Multimedia/Vlc/LibVlc/VlcException.cs

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