-
Notifications
You must be signed in to change notification settings - Fork 0
/
VowI.cs
66 lines (53 loc) · 1.04 KB
/
VowI.cs
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using nilnul.obj._vow;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace nilnul.bit
{
public interface VowI:nilnul.obj.VowI<bool>
{
}
public class Vow<TXpn> :
nilnul.bit.Boxed,
VowI, nilnul.obj.VowI2<bool>
where TXpn: Exception,new()
{
private TXpn _xpn;
public TXpn xpn
{
get { return _xpn; }
set { _xpn = value; }
}
public Vow(bool val, TXpn xpn) : base(val)
{
_xpn = xpn;
}
public Vow(bool val, string msg):this(val, new TXpn() { Source=msg })
{
}
public Vow(bool val):this(val, null as string)
{
}
public void vow(bool obj)
{
if (obj != this.boxed)
{
throw this._xpn;
}
}
}
public class Vow : Vow<nilnul.obj._vow.FailException<Vow>>
{
public Vow(bool val) : base(val)
{
}
public Vow(bool val, FailException<Vow> xpn) : base(val, xpn)
{
}
public Vow(bool val, string msg) : this(val,new FailException<Vow>(msg))
{
}
}
}