领胜LDS 键盘AOI检测项目
wells.liu
2020-07-07 5918194fccdb2a2303e713b8d2f3335243b9e2ef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
 
namespace Bro.Common.Helper
{
    public enum ExceptionLevel
    {
        Info = 0,
        Warning = 1,
        Fatal = 2,
    }
 
    //public delegate void OnProcessExceptionRaisedDelegate(DateTime dt, ProcessException ex);
    //[Serializable]
    public class ProcessException : Exception
    {
        //public static event OnProcessExceptionRaisedDelegate OnProcessExceptionRaised;
 
        public ExceptionLevel Level { get; set; } = ExceptionLevel.Warning;
 
        public ProcessException()
        {
        }
 
        public ProcessException(Exception ex, ExceptionLevel lvl = ExceptionLevel.Warning) : base(ex.Message, ex)
        {
            Level = lvl;
            ExceptionNotice();
        }
 
        public ProcessException(string error, Exception ex = null, ExceptionLevel lvl = ExceptionLevel.Warning) : base(error, ex)
        {
            Level = lvl;
            ExceptionNotice();
        }
 
        public void ExceptionNotice()
        {
            //OnProcessExceptionRaised?.Invoke(DateTime.Now, this);
        }
    }
 
    public class AuthorityException : ProcessException
    {
    }
}