Mercurial > repos > IBDev-IBBoard.WarFoundry.API
annotate api/Requirements/RequirementAND.cs @ 159:7b98e71b8511
Re #152: Test and fix extensibility of current schemas
* Add "any" elements and "anyAttributes" to schemas where appropriate
Still need to handle cleansing with XSLT
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Wed, 30 Sep 2009 19:08:08 +0000 |
parents | 2f3cafb69799 |
children | 6083010a005c |
rev | line source |
---|---|
104
2f3cafb69799
Re #121: Migrate to AGPL license
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
1 // This file (RequirementAND.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009 IBBoard. |
15 | 2 // |
104
2f3cafb69799
Re #121: Migrate to AGPL license
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
3 // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. |
15 | 4 |
0 | 5 using System; |
6 using System.Collections.Generic; | |
7 using IBBoard.Lang; | |
82 | 8 using IBBoard.WarFoundry.API.Objects; |
9 | |
10 namespace IBBoard.WarFoundry.API.Requirements | |
11 { | |
12 /// <summary> | |
13 /// Summary description for RequirementAND. | |
14 /// </summary> | |
15 public class RequirementAND : AbstractRequirement | |
16 { | |
17 private static string and; | |
18 | |
19 static RequirementAND() | |
20 { | |
21 and = Translation.GetTranslation("requirement_and", true); | |
22 | |
23 if (and == null) | |
24 { | |
25 and = "{0}; and {1}"; | |
26 } | |
27 } | |
28 | |
29 private AbstractRequirement reqA, reqB; | |
30 | |
31 public RequirementAND(AbstractRequirement requirementA, AbstractRequirement requirementB) | |
32 { | |
33 reqA = requirementA; | |
34 reqB = requirementB; | |
35 } | |
36 | |
37 public override AbstractFailedRequirement CanAddToWarFoundryObject(WarFoundryObject obj) | |
0 | 38 { |
39 FailedRequirement failed = null; | |
82 | 40 |
0 | 41 if (reqA.CanAddToWarFoundryObject(obj) !=null || reqB.CanAddToWarFoundryObject(obj)!=null) |
42 { | |
43 failed = new FailedRequirement(this); | |
44 } | |
45 | |
82 | 46 return failed; |
47 } | |
48 | |
49 public override AbstractFailedRequirement CanRemoveFromWarFoundryObject(WarFoundryObject obj) | |
0 | 50 { |
51 FailedRequirement failed = null; | |
82 | 52 |
0 | 53 if (reqA.CanRemoveFromWarFoundryObject(obj) !=null || reqB.CanRemoveFromWarFoundryObject(obj)!=null) |
54 { | |
55 failed = new FailedRequirement(this); | |
56 } | |
57 | |
82 | 58 return failed; |
59 } | |
60 | |
61 public override string Description | |
62 { | |
63 get { return String.Format(and, reqA.Description, reqB.Description); } | |
64 } | |
65 } | |
66 } |