Fixing an issue with output parameters that are of type IntPtr
[castle.git] / Tools / ManagedExtensions / ManagementExtensions / ManagementInfo.cs
blobd2eb54f070b4c9abf7e3192c5215dd28b901c8f1
1 // Copyright 2003-2004 DigitalCraftsmen - http://www.digitalcraftsmen.com.br/
2 //
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
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
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
17 using System;
18 using System.Collections;
19 using System.Collections.Specialized;
21 /// <summary>
22 /// Summary description for ManagementInfo.
23 /// </summary>
24 [Serializable]
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
39 get
41 return description;
43 set
45 description = value;
49 public ManagementObjectCollection Operations
51 get
53 return operations;
57 public ManagementObjectCollection Attributes
59 get
61 return attributes;
66 /// <summary>
67 ///
68 /// </summary>
69 [Serializable]
70 public class ManagementObject
72 protected String name;
73 protected String description;
75 public String Name
77 get
79 return name;
81 set
83 name = value;
87 public String Description
89 get
91 return description;
93 set
95 description = value;
100 /// <summary>
101 ///
102 /// </summary>
103 [Serializable]
104 public class ManagementOperation : ManagementObject
106 private Type[] arguments = new Type[0];
108 public ManagementOperation()
112 public ManagementOperation(String name)
114 Name = name;
117 public ManagementOperation(String name, String description)
119 Name = name;
120 Description = description;
123 public ManagementOperation(String name, String description, Type[] args)
125 Name = name;
126 Description = description;
127 arguments = args;
130 public Type[] Arguments
134 return arguments;
139 /// <summary>
140 ///
141 /// </summary>
142 [Serializable]
143 public class ManagementAttribute : ManagementObject
145 protected Type type;
147 public ManagementAttribute(String name, Type attType)
149 Name = name;
150 type = attType;
153 public ManagementAttribute(String name, String description, Type attType)
155 Name = name;
156 Description = description;
157 type = attType;
160 public Type AttributeType
164 return type;
169 /// <summary>
170 ///
171 /// </summary>
172 [Serializable]
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();
211 #endregion