returntype.cs

来自「c#源代码」· CS 代码 · 共 69 行

CS
69
字号
// created on 04.08.2003 at 18:08
using System;
using SharpDevelop.Internal.Parser;

namespace VBBinding.Parser.SharpDevelopTree
{
	public class ReturnType : AbstractReturnType
	{
		public new int PointerNestingLevel {
			get {
				return base.pointerNestingLevel;
			}
			set {
				base.pointerNestingLevel = value;
			}
		}
		
		public new int[] ArrayDimensions {
			get {
				return base.arrayDimensions;
			}
			set {
				base.arrayDimensions = value;
			}
		}
		
		public ReturnType(string fullyQualifiedName)
		{
			base.FullyQualifiedName = fullyQualifiedName;
//			Console.WriteLine("NEW RETURN TYPE WITH : " + fullyQualifiedName);
		}
		
		public ReturnType(string fullyQualifiedName, int[] arrayDimensions, int pointerNestingLevel)
		{
			this.FullyQualifiedName  = fullyQualifiedName;
			this.arrayDimensions     = arrayDimensions;
			this.pointerNestingLevel = pointerNestingLevel;
		}
		
		public ReturnType(ICSharpCode.SharpRefactory.Parser.AST.VB.TypeReference type)
		{
			if (type == null) {
				base.FullyQualifiedName = "System.Object";
				return;
			}
			
			base.FullyQualifiedName  = type.SystemType == null ? type.Type : type.SystemType;
			base.arrayDimensions     = new int[] {};
			
			if(type.RankSpecifier != null) {
				try {
					base.arrayDimensions = (int[])type.RankSpecifier.ToArray(typeof(int));
				} catch(InvalidCastException) {
					// the AST is not optimal here: arguments in array creation expressions
					// shouldn't be stored in the rankspecifier property. 
				}
			}
			
			
			base.pointerNestingLevel = 0;
		}
		
		public ReturnType Clone()
		{
			return new ReturnType(FullyQualifiedName, arrayDimensions, pointerNestingLevel);
		}
	}
}

⌨️ 快捷键说明

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