Пример #1
0
		public static Error.IError Create(Error.Level level, string title, System.Exception exception)
		{
			System.Reflection.MethodBase method = exception.TargetSite ?? new System.Diagnostics.StackTrace().GetFrame(2).GetMethod();
			Type type = method.DeclaringType;
			System.Reflection.AssemblyName assembly = type.NotNull() ? type.Assembly.GetName() : null;
			return new Entry() {
				Time = DateTime.Now,
				Level = level,
				Title = title,
				Message = exception.Message,
				AssemblyName = assembly.NotNull() ? assembly.Name : "",
				AssemblyVersion = assembly.NotNull() ? assembly.Version.ToString() : "",
				Type = type.FullName,
				Method = method.Name,
			};
		}
Пример #2
0
		public static Error.IError Create(Error.Level level, string title, string message)
		{
			System.Diagnostics.StackFrame frame = new System.Diagnostics.StackTrace().GetFrame(2);
			System.Reflection.MethodBase method = frame.GetMethod();
			Type type = method.DeclaringType;
			System.Reflection.AssemblyName assembly = type.Assembly.GetName();
			return new Entry() {
				Time = DateTime.Now,
				Level = level,
				Title = title,
				Message = message,
				AssemblyName = assembly.Name,
				AssemblyVersion = assembly.Version.ToString(),
				Type = type.FullName,
				Method = method.Name,
				Filename = frame.GetFileName(),
				Line = frame.GetFileLineNumber(),
				Column = frame.GetFileColumnNumber(),
			};
		}
Пример #3
0
 internal Abstract(System.Exception innerException, Error.Level level, string title, string message, params string[] arguments)
     : base(innerException, level, title, message, arguments)
 {
 }
Пример #4
0
 internal Abstract(Error.Level level, string title, string message, params string[] arguments)
     : this(null, level, title, message, arguments)
 {
 }
Пример #5
0
 internal Exception(Error.Level level, string title, string message, params object[] arguments)
     : base(level, title, message, arguments)
 {
 }
Пример #6
0
		internal static void Check(Target.Level level, string title, string message, params object[] arguments)
		{
			new Exception.Test(level, title, message, arguments).Throw();
		}
Пример #7
0
		internal Test (Abstract exception, Target.Level level, string title, string message, params object[] arguments) :
			base(exception, level, title, message, arguments)
		{ }
Пример #8
0
		internal Test (Target.Level level, string title, string message, params object[] arguments) :
			this(null, level, title, message, arguments)
		{ }