From 458f774d0fab696e1a5cb5511a0feb9aae0fc694 Mon Sep 17 00:00:00 2001 From: Matt Ward Date: Sat, 4 Jan 2014 13:00:51 +0000 Subject: [PATCH] Only use NRefactory in EnvDTE.CodeType. --- .../Project/Src/EnvDTE/CodeClass.cs | 2 -- .../Project/Src/EnvDTE/CodeType.cs | 30 ++----------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeClass.cs b/src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeClass.cs index 539e39a8c3..94cc08bf06 100644 --- a/src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeClass.cs +++ b/src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeClass.cs @@ -4,8 +4,6 @@ using System; using System.Linq; using ICSharpCode.NRefactory.TypeSystem; -using ICSharpCode.SharpDevelop.Dom; -using ICSharpCode.SharpDevelop.Project; namespace ICSharpCode.PackageManagement.EnvDTE { diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeType.cs b/src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeType.cs index 6713051125..9f5c94d7df 100644 --- a/src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeType.cs +++ b/src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeType.cs @@ -8,14 +8,11 @@ using System.Text; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.SharpDevelop; -using ICSharpCode.SharpDevelop.Dom; -using ICSharpCode.SharpDevelop.Project; namespace ICSharpCode.PackageManagement.EnvDTE { public class CodeType : CodeElement, global::EnvDTE.CodeType { - protected readonly ITypeDefinitionModel typeModel; protected readonly ITypeDefinition typeDefinition; IType[] typeArguments; @@ -50,13 +47,6 @@ namespace ICSharpCode.PackageManagement.EnvDTE } } - public CodeType(CodeModelContext context, ITypeDefinitionModel typeModel) - : base(context, typeModel) - { - this.typeModel = typeModel; - this.InfoLocation = GetInfoLocationOld(); - } - public CodeType(CodeModelContext context, ITypeDefinition typeDefinition, params IType[] typeArguments) : base(context, typeDefinition) { @@ -73,14 +63,6 @@ namespace ICSharpCode.PackageManagement.EnvDTE return global::EnvDTE.vsCMInfoLocation.vsCMInfoLocationExternal; } - global::EnvDTE.vsCMInfoLocation GetInfoLocationOld() - { - if (typeModel != null) { - return global::EnvDTE.vsCMInfoLocation.vsCMInfoLocationProject; - } - return global::EnvDTE.vsCMInfoLocation.vsCMInfoLocationExternal; - } - public CodeType() { } @@ -96,7 +78,7 @@ namespace ICSharpCode.PackageManagement.EnvDTE public virtual string FullName { get { - FullTypeName fullTypeName = GetFullTypeName(); + FullTypeName fullTypeName = typeDefinition.FullTypeName; var fullName = new StringBuilder(); if (!string.IsNullOrEmpty(fullTypeName.TopLevelTypeName.Namespace)) { fullName.Append(fullTypeName.TopLevelTypeName.Namespace); @@ -111,14 +93,6 @@ namespace ICSharpCode.PackageManagement.EnvDTE } } - FullTypeName GetFullTypeName() - { - if (typeModel != null) { - return typeModel.FullTypeName; - } - return typeDefinition.FullTypeName; - } - string GetTypeArguments() { if (typeArguments.Length == 0) { @@ -173,7 +147,7 @@ namespace ICSharpCode.PackageManagement.EnvDTE public virtual global::EnvDTE.CodeNamespace Namespace { get { if (context.FilteredFileName != null) { - return new FileCodeModel2(context, null).GetNamespace(typeModel.Namespace); + return new FileCodeModel2(context, null).GetNamespace(typeDefinition.Namespace); } else { throw new NotImplementedException(); // return new CodeNamespace(context, typeDefinition.Namespace);