1 //------------------------------------------------------------------------------
2 // <copyright file="CodeParameterDeclarationExpression.cs" company="Microsoft">
4 // <OWNER>[....]</OWNER>
5 // Copyright (c) Microsoft Corporation. All rights reserved.
7 //------------------------------------------------------------------------------
9 namespace System.CodeDom {
11 using System.Diagnostics;
13 using Microsoft.Win32;
14 using System.Collections;
15 using System.Runtime.InteropServices;
19 /// Represents a parameter declaration for method, constructor, or property arguments.
23 ClassInterface(ClassInterfaceType.AutoDispatch),
27 public class CodeParameterDeclarationExpression : CodeExpression {
28 private CodeTypeReference type;
30 private CodeAttributeDeclarationCollection customAttributes = null;
31 private FieldDirection dir = FieldDirection.In;
36 /// Initializes a new instance of <see cref='System.CodeDom.CodeParameterDeclarationExpression'/>.
39 public CodeParameterDeclarationExpression() {
44 /// Initializes a new instance of <see cref='System.CodeDom.CodeParameterDeclarationExpression'/> using the specified type and name.
47 public CodeParameterDeclarationExpression(CodeTypeReference type, string name) {
53 /// <para>[To be supplied.]</para>
55 public CodeParameterDeclarationExpression(string type, string name) {
56 Type = new CodeTypeReference(type);
61 /// <para>[To be supplied.]</para>
63 public CodeParameterDeclarationExpression(Type type, string name) {
64 Type = new CodeTypeReference(type);
70 /// Gets or sets the custom attributes for the parameter declaration.
73 public CodeAttributeDeclarationCollection CustomAttributes {
75 if (customAttributes == null) {
76 customAttributes = new CodeAttributeDeclarationCollection();
78 return customAttributes;
81 customAttributes = value;
88 /// the direction of the field.
91 public FieldDirection Direction {
103 /// the type of the parameter.
106 public CodeTypeReference Type {
109 type = new CodeTypeReference("");
121 /// the name of the parameter.
126 return (name == null) ? string.Empty : name;