| |||||||||||||||||
Source File | Conditionals | Statements | Methods | TOTAL | |||||||||||||
Seasar.Framework.Container\Util\AspectDefSupport.cs | 75.0% | 88.9% | 100.0% | 88.9% |
|
1 | #region Copyright | |
2 | /* | |
3 | * Copyright 2005 the Seasar Foundation and the Others. | |
4 | * | |
5 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
6 | * you may not use this file except in compliance with the License. | |
7 | * You may obtain a copy of the License at | |
8 | * | |
9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
10 | * | |
11 | * Unless required by applicable law or agreed to in writing, software | |
12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | |
14 | * either express or implied. See the License for the specific language | |
15 | * governing permissions and limitations under the License. | |
16 | */ | |
17 | #endregion | |
18 | ||
19 | using System; | |
20 | using System.Collections; | |
21 | ||
22 | namespace Seasar.Framework.Container.Util | |
23 | { | |
24 | /// <summary> | |
25 | /// AspectDefSupport の概要の説明です。 | |
26 | /// </summary> | |
27 | public sealed class AspectDefSupport | |
28 | { | |
29 | private IList aspectDefs_ = ArrayList.Synchronized(new ArrayList()); | |
30 | private IS2Container container_; | |
31 | ||
32 | /// <summary> | |
33 | /// コンストラクタ | |
34 | /// </summary> | |
35 | 791 | public AspectDefSupport() |
36 | { | |
37 | } | |
38 | ||
39 | /// <summary> | |
40 | /// IAspectDefを追加します。 | |
41 | /// </summary> | |
42 | /// <param name="aspectDef"></param> | |
43 | 42 | public void AddAspectDef(IAspectDef aspectDef) |
44 | { | |
45 | 42 | if(container_ != null) |
46 | { | |
47 | 0 | aspectDef.Container = container_; |
48 | } | |
49 | 42 | aspectDefs_.Add(aspectDef); |
50 | } | |
51 | ||
52 | /// <summary> | |
53 | /// IAspectDefの数 | |
54 | /// </summary> | |
55 | public int AspectDefSize | |
56 | { | |
57 | 399 | get { return aspectDefs_.Count; } |
58 | } | |
59 | ||
60 | /// <summary> | |
61 | /// 番号を指定してIAspectDefを返します。 | |
62 | /// </summary> | |
63 | /// <param name="index">番号</param> | |
64 | /// <returns>IAspectDef</returns> | |
65 | 49 | public IAspectDef GetAspectDef(int index) |
66 | { | |
67 | 49 | return (IAspectDef) aspectDefs_[index]; |
68 | } | |
69 | ||
70 | /// <summary> | |
71 | /// S2Container | |
72 | /// </summary> | |
73 | public IS2Container Container | |
74 | { | |
75 | 788 | set |
76 | { | |
77 | 788 | container_ = value; |
78 | 788 | IEnumerator enu = aspectDefs_.GetEnumerator(); |
79 | 830 | while(enu.MoveNext()) |
80 | { | |
81 | 42 | ((IAspectDef) enu.Current).Container = value; |
82 | } | |
83 | } | |
84 | } | |
85 | } | |
86 | } | |
87 |
|