1
// ReflectionParameter.cs
3
// This file was derived from a file from #Develop.
5
// Copyright (C) 2001-2007 Mike Krüger <mkrueger@novell.com>
7
// This program is free software; you can redistribute it and/or modify
8
// it under the terms of the GNU General Public License as published by
9
// the Free Software Foundation; either version 2 of the License, or
10
// (at your option) any later version.
12
// This program is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
// GNU General Public License for more details.
17
// You should have received a copy of the GNU General Public License
18
// along with this program; if not, write to the Free Software
19
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24
namespace MonoDevelop.Projects.Parser
27
internal class ReflectionParameter : DefaultParameter
29
public ReflectionParameter (ParameterDefinition parameterInfo, XmlNode methodNode)
31
name = parameterInfo.Name;
32
returnType = new ReflectionReturnType(parameterInfo.ParameterType);
34
TypeReference type = parameterInfo.ParameterType;
35
if (type is ArrayType && type.FullName != "System.Array") {
36
foreach (CustomAttribute att in parameterInfo.CustomAttributes)
37
if (att.Constructor.DeclaringType.FullName == "System.ParamArrayAttribute") {
38
modifier |= ParameterModifier.Params;
43
if ((parameterInfo.Attributes & ParameterAttributes.Out) != 0) {
44
modifier |= ParameterModifier.Out;
45
} else if (returnType.ByRef) {
46
// FIX: We should look at the return type of this parameter to
47
// determine whether a parameter is 'ref'
48
modifier |= ParameterModifier.Ref;
51
if (methodNode != null) {
52
XmlNode paramDocu = methodNode.SelectSingleNode("Docs/param[@name='" + parameterInfo.Name + "']");
53
if (paramDocu != null) {
54
documentation = paramDocu.InnerXml;