Mercurial > repos > IBBoard
annotate Limits/AbstractLimit.cs @ 73:091bfa54d6c7
Re #33: Add method to get list of available translations
* Add "translation language" object to pair up code and name
* Load all translations at initialisation time
Also:
* Remove rogue "set" property on abstract translation set
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Tue, 06 Apr 2010 18:58:30 +0000 |
parents | 44bc5bd5c2f3 |
children |
rev | line source |
---|---|
49
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 // This file (AbstractLimit.cs) is a part of the IBBoard project and is copyright 2009 IBBoard |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 // |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
3 // The file and the library/program it is in are licensed under the GNU LGPL license, either version 3 of the License or (at your option) any later version. Please see COPYING.LGPL for more information and the full license. |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 using System; |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 |
56 | 7 namespace IBBoard.Limits |
49
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
8 { |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
9 /// <summary> |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
10 /// The abstract base class for all limits |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
11 /// </summary> |
57 | 12 public abstract class AbstractLimit : ILimit |
49
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
13 { |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
14 private double limit; |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
15 |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
16 public AbstractLimit (double limitNum) |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
17 { |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
18 limit = limitNum; |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
19 } |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
20 |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
21 protected double Limit |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
22 { |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
23 get |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
24 { |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
25 return limit; |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
26 } |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
27 } |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
28 |
51 | 29 public override int GetHashCode () |
30 { | |
31 int hash = GetType().GetHashCode(); | |
32 hash+= Limit.GetHashCode(); | |
33 return hash; | |
34 } | |
57 | 35 |
36 public abstract int GetLimit(int size); | |
51 | 37 |
38 public override bool Equals (object obj) | |
39 { | |
40 bool equal = false; | |
41 | |
42 if (obj != null && GetType().Equals(obj.GetType())) | |
43 { | |
44 equal = (Limit == ((AbstractLimit)obj).Limit); | |
45 } | |
46 | |
47 return equal; | |
48 } | |
49 | |
49
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
50 } |
a177a3750acd
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
51 } |