1 // Copyright 2003-2004 DigitalCraftsmen - http://www.digitalcraftsmen.com.br/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.ManagementExtensions
18 using System
.Collections
;
19 using System
.Collections
.Specialized
;
22 /// Summary description for ManagementInfo.
25 public class ManagementInfo
27 protected String description
;
28 // TODO: Replate by Collection
29 protected ManagementObjectCollection operations
= new ManagementObjectCollection();
30 // TODO: Replate by Collection
31 protected ManagementObjectCollection attributes
= new ManagementObjectCollection();
33 public ManagementInfo()
37 public String Description
49 public ManagementObjectCollection Operations
57 public ManagementObjectCollection Attributes
70 public class ManagementObject
72 protected String name
;
73 protected String description
;
87 public String Description
104 public class ManagementOperation
: ManagementObject
106 private Type
[] arguments
= new Type
[0];
108 public ManagementOperation()
112 public ManagementOperation(String name
)
117 public ManagementOperation(String name
, String description
)
120 Description
= description
;
123 public ManagementOperation(String name
, String description
, Type
[] args
)
126 Description
= description
;
130 public Type
[] Arguments
143 public class ManagementAttribute
: ManagementObject
147 public ManagementAttribute(String name
, Type attType
)
153 public ManagementAttribute(String name
, String description
, Type attType
)
156 Description
= description
;
160 public Type AttributeType
173 public class ManagementObjectCollection
: NameObjectCollectionBase
, IEnumerable
175 public ManagementObjectCollection() :
176 base(CaseInsensitiveHashCodeProvider
.Default
, CaseInsensitiveComparer
.Default
)
180 public ManagementObjectCollection(
181 System
.Runtime
.Serialization
.SerializationInfo info
,
182 System
.Runtime
.Serialization
.StreamingContext context
) : base(info
, context
)
186 public void Add(ManagementObject obj
)
188 base.BaseAdd(obj
.Name
, obj
);
191 public ManagementObject
this[String name
]
195 return (ManagementObject
) base.BaseGet(name
);
199 public bool Contains(String name
)
201 return BaseGet(name
) != null;
204 #region IEnumerable Members
206 public new IEnumerator
GetEnumerator()
208 return base.BaseGetAllValues().GetEnumerator();