From 1ebd70ef11b1384330f8e45d0b52e2e2aa95334f Mon Sep 17 00:00:00 2001 From: rupertavery Date: Tue, 5 Dec 2017 22:24:17 +0800 Subject: [PATCH] Fixes Issue #1 --- VsTools.Projects/ItemGroupContent.cs | 6 +++++- VsTools.Projects/Reflection.cs | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/VsTools.Projects/ItemGroupContent.cs b/VsTools.Projects/ItemGroupContent.cs index 4fe0493..6e3491e 100644 --- a/VsTools.Projects/ItemGroupContent.cs +++ b/VsTools.Projects/ItemGroupContent.cs @@ -2,12 +2,16 @@ namespace VsTools.Projects { - public abstract class ItemGroupContent : CsProjectNode + public class ItemGroupContent : CsProjectNode { public override int Depth => 2; private string _include; + public override string ElementName { + get { return ((XElement) Node).Name.LocalName; } + } + public string Include { get { return _include; } diff --git a/VsTools.Projects/Reflection.cs b/VsTools.Projects/Reflection.cs index 0fd39bd..c891129 100644 --- a/VsTools.Projects/Reflection.cs +++ b/VsTools.Projects/Reflection.cs @@ -15,7 +15,12 @@ static Reflection() public static Type GetItemGroupContentTypeFromName(string name) { - return _typelookup[name]; + Type type; + if (_typelookup.TryGetValue(name, out type)) + { + return typeof(ItemGroupContent); + } + return type; } } } \ No newline at end of file