parameterdeclarationexpression.cs

来自「全功能c#编译器」· CS 代码 · 共 85 行

CS
85
字号


using System;
using System.Diagnostics;
using System.Collections.Generic;

namespace ICSharpCode.CsVbRefactory.Parser.AST
{	
	public class ParameterDeclarationExpression : Expression
	{
		TypeReference  typeReference = TypeReference.Null;
		string         parameterName = "";
		ParamModifiers paramModifiers = ParamModifiers.In;
		List<AttributeSection> attributes = new List<AttributeSection>(1);
		
		public TypeReference TypeReference {
			get {
				return typeReference;
			}
			set {
				Debug.Assert(value != null);
				typeReference = value;
			}
		}
		public string ParameterName {
			get {
				return parameterName;
			}
			set {
				Debug.Assert(value != null);
				parameterName = value;
			}
		}
		
		public ParamModifiers ParamModifiers {
			get {
				return paramModifiers;
			}
			set {
				paramModifiers = value;
			}
		}
		
		public List<AttributeSection> Attributes {
			get {
				return attributes;
			}
			set {
				Debug.Assert(value != null);
				attributes = value;
			}
		}
		
		public ParameterDeclarationExpression(TypeReference typeReference, string parameterName)
		{
			this.typeReference  = typeReference;
			Debug.Assert(parameterName != null);
			this.parameterName  = parameterName;
			this.paramModifiers = ParamModifiers.In;
		}
		
		public ParameterDeclarationExpression(TypeReference typeReference, string parameterName, ParamModifiers paramModifiers)
		{
			this.typeReference  = typeReference;
			Debug.Assert(parameterName != null);
			this.parameterName  = parameterName;
			this.paramModifiers = paramModifiers;
		}
		
		public override object AcceptVisitor(IASTVisitor visitor, object data)
		{
			return visitor.Visit(this, data);
		}
		public override string ToString()
		{
			return String.Format("[ParameterDeclarationExpression: TypeReference={0}, ParameterName={1}, ParamModifiers={2}, Attributes={3}]",
			                     TypeReference,
			                     ParameterName,
			                     ParamModifiers,
			                     GetCollectionString(Attributes));
		}
		
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?