PageRenderTime 14ms CodeModel.GetById 11ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/IReturnTypeExtensions.cs

https://github.com/ajadex/SharpDevelop
C# | 101 lines | 0 code | 1 blank | 100 comment | 0 complexity | 1c983313f7e0846d7ca12a1503136bf4 MD5 | raw file
  1// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
  2// 
  3// Permission is hereby granted, free of charge, to any person obtaining a copy of this
  4// software and associated documentation files (the "Software"), to deal in the Software
  5// without restriction, including without limitation the rights to use, copy, modify, merge,
  6// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
  7// to whom the Software is furnished to do so, subject to the following conditions:
  8// 
  9// The above copyright notice and this permission notice shall be included in all copies or
 10// substantial portions of the Software.
 11// 
 12// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
 13// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 14// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
 15// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
 16// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 17// DEALINGS IN THE SOFTWARE.
 18
 19//using System;
 20//using System.Collections.Generic;
 21//using ICSharpCode.NRefactory.Ast;
 22//using ICSharpCode.SharpDevelop.Dom;
 23//
 24//namespace ICSharpCode.PackageManagement.EnvDTE
 25//{
 26//	internal static class IReturnTypeExtensions
 27//	{
 28//		public static string GetFullName(this IReturnType returnType)
 29//		{
 30//			return returnType
 31//				.DotNetName
 32//				.Replace('{', '<')
 33//				.Replace('}', '>');
 34//		}
 35//		
 36//		public static string AsCSharpString(this IReturnType returnType)
 37//		{
 38//			string name = String.Empty;
 39//			if (TypeReference.PrimitiveTypesCSharpReverse.TryGetValue(returnType.FullyQualifiedName, out name)) {
 40//				return name;
 41//			}
 42//			return returnType.GetFullName();
 43//		}
 44//		
 45//		public static string AsVisualBasicString(this IReturnType returnType)
 46//		{
 47//			string name = String.Empty;
 48//			if (TypeReference.PrimitiveTypesVBReverse.TryGetValue(returnType.FullyQualifiedName, out name)) {
 49//				return name;
 50//			}
 51//			return returnType.GetFullName();
 52//		}
 53//		
 54//		public static global::EnvDTE.vsCMTypeRef GetTypeKind(this IReturnType returnType)
 55//		{
 56//			global::EnvDTE.vsCMTypeRef typeRef = GetSystemTypeKind(returnType.FullyQualifiedName);
 57//			if (typeRef != global::EnvDTE.vsCMTypeRef.vsCMTypeRefOther) {
 58//				return typeRef;
 59//			}
 60//			
 61//			if (returnType.IsReferenceType.GetValueOrDefault()) {
 62//				return global::EnvDTE.vsCMTypeRef.vsCMTypeRefCodeType;
 63//			}
 64//			return global::EnvDTE.vsCMTypeRef.vsCMTypeRefOther;
 65//		}
 66//		
 67//		static global::EnvDTE.vsCMTypeRef GetSystemTypeKind(string fullyQualifiedTypeName)
 68//		{
 69//			switch (fullyQualifiedTypeName) {
 70//				case "System.String":
 71//					return global::EnvDTE.vsCMTypeRef.vsCMTypeRefString;
 72//				case "System.Void":
 73//					return global::EnvDTE.vsCMTypeRef.vsCMTypeRefVoid;
 74//				case "System.Boolean":
 75//					return global::EnvDTE.vsCMTypeRef.vsCMTypeRefBool;
 76//				case "System.Int16":
 77//				case "System.UInt16":
 78//					return global::EnvDTE.vsCMTypeRef.vsCMTypeRefShort;
 79//				case "System.Int32":
 80//				case "System.UInt32":
 81//					return global::EnvDTE.vsCMTypeRef.vsCMTypeRefInt;
 82//				case "System.Int64":
 83//				case "System.UInt64":
 84//					return global::EnvDTE.vsCMTypeRef.vsCMTypeRefLong;
 85//				case "System.Decimal":
 86//					return global::EnvDTE.vsCMTypeRef.vsCMTypeRefDecimal;
 87//				case "System.Char":
 88//					return global::EnvDTE.vsCMTypeRef.vsCMTypeRefChar;
 89//				case "System.Byte":
 90//					return global::EnvDTE.vsCMTypeRef.vsCMTypeRefByte;
 91//				case "System.Object":
 92//					return global::EnvDTE.vsCMTypeRef.vsCMTypeRefObject;
 93//				case "System.Double":
 94//					return global::EnvDTE.vsCMTypeRef.vsCMTypeRefDouble;
 95//				case "System.Single":
 96//					return global::EnvDTE.vsCMTypeRef.vsCMTypeRefFloat;
 97//			}
 98//			return global::EnvDTE.vsCMTypeRef.vsCMTypeRefOther;
 99//		}
100//	}
101//}