| |||||||||||||||||
Source File | Conditionals | Statements | Methods | TOTAL | |||||||||||||
Seasar.Framework.Container\Util\ArgDefSupport.cs | 75.0% | 90.0% | 100.0% | 89.5% |
|
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 | /// IArgDefの設定をサポートします。 | |
26 | /// </summary> | |
27 | public class ArgDefSupport | |
28 | { | |
29 | private IList argDefs_ = ArrayList.Synchronized(new ArrayList()); | |
30 | private IS2Container container_; | |
31 | ||
32 | /// <summary> | |
33 | /// コンストラクタ | |
34 | /// </summary> | |
35 | 822 | public ArgDefSupport() |
36 | { | |
37 | } | |
38 | ||
39 | /// <summary> | |
40 | /// コンストラクタ | |
41 | /// </summary> | |
42 | /// <param name="argDef">IArgDef</param> | |
43 | 268 | public void AddArgDef(IArgDef argDef) |
44 | { | |
45 | 268 | if(container_ != null) |
46 | { | |
47 | 0 | argDef.Container = container_; |
48 | } | |
49 | 268 | argDefs_.Add(argDef); |
50 | } | |
51 | ||
52 | /// <summary> | |
53 | /// IArgDefの数 | |
54 | /// </summary> | |
55 | public int ArgDefSize | |
56 | { | |
57 | 631 | get |
58 | { | |
59 | 631 | return argDefs_.Count; |
60 | } | |
61 | } | |
62 | ||
63 | /// <summary> | |
64 | /// 番号を指定してIArgDefを取得します。 | |
65 | /// </summary> | |
66 | /// <param name="index">番号</param> | |
67 | /// <returns>IArgDef</returns> | |
68 | 220 | public IArgDef GetArgDef(int index) |
69 | { | |
70 | 220 | return (IArgDef) argDefs_[index]; |
71 | } | |
72 | ||
73 | /// <summary> | |
74 | /// S2Container | |
75 | /// </summary> | |
76 | public IS2Container Container | |
77 | { | |
78 | 816 | set |
79 | { | |
80 | 816 | container_ = value; |
81 | 816 | IEnumerator enu = argDefs_.GetEnumerator(); |
82 | 1082 | while(enu.MoveNext()) |
83 | { | |
84 | 266 | IArgDef argDef = (IArgDef)enu.Current; |
85 | 266 | argDef.Container = value; |
86 | } | |
87 | } | |
88 | } | |
89 | } | |
90 | } | |
91 |
|