ningshuxia
2025-03-27 afbafeecc1325bff849a17fb63b9b2b65b48ddf1
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
using IStation.Epanet.Enums;
 
namespace IStation.Epanet
{
    class InputException : EnException
    {
 
        private readonly SectType _section;
        public string Arg { get; }
 
        public InputException(ErrorCode code, SectType section, string arg) : base(code)
        {
            _section = section;
            Arg = arg;
        }
 
        public override string Message
        {
            get
            {
                string fmt;
 
                try
                {
                    fmt = _code.GetMsg();
                }
                catch (Exception)
                {
                    fmt = null;
                }
 
                return fmt == null
                    ? string.Format("Unknown error #({0})", (int)_code)
                    : string.Format(fmt, _section.ToString(), Arg);
            }
        }
 
    }
}