-
Notifications
You must be signed in to change notification settings - Fork 0
/
PhoneRange.cs
66 lines (55 loc) · 1.49 KB
/
PhoneRange.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
/*
Copyright 2022 Smyrilline
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
Author: Tummas Andreasen
*/
namespace FaroeseTelecom
{
public class PhoneRange
{
private int _Start;
public int Start { get => _Start; set { if (!_Locked) { _Start = value; } } }
private int _End;
public int End { get => _End; set { if (!_Locked) { _End = value; } } }
private bool _Allowed = false;
public bool Allowed { get => _Allowed; set { if (!_Locked) { _Allowed = value; } } }
private NumberType _Type;
public NumberType Type { get => _Type; set { if (!_Locked) { _Type = value; } } }
private string _Description;
public string Description { get => _Description; set { if (!_Locked) { _Description = value; } } }
private bool _Locked = false;
public bool Locked
{
get => _Locked;
set
{
if (!_Locked)
_Locked = value;
}
}
public PhoneRange() { }
public PhoneRange(int Start, int End, bool Allowed, NumberType Type, string Description, bool Locked = true)
{
this._Start = Start;
this._End = End;
this._Allowed = Allowed;
this._Type = Type;
this._Description = Description;
this._Locked = Locked;
}
public PhoneRange Copy(bool LockCopy = false)
{
return new PhoneRange()
{
Start = this._Start,
End = this._End,
Allowed = this._Allowed,
Type = this._Type,
Description = this._Description,
Locked = LockCopy
};
}
}
}