-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TypeMapping and actually using SolutionFolder now
Closes #3
- Loading branch information
Showing
7 changed files
with
145 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System; | ||
|
||
namespace SlnParser.Contracts.Helper | ||
{ | ||
public interface IProjectTypeMapper | ||
{ | ||
ProjectType Map(Guid typeGuid); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using SlnParser.Contracts; | ||
using SlnParser.Contracts.Helper; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace SlnParser.Helper | ||
{ | ||
public class ProjectTypeMapper : IProjectTypeMapper | ||
{ | ||
private readonly IDictionary<Guid, ProjectType> _mapping; | ||
|
||
public ProjectTypeMapper() | ||
{ | ||
_mapping = GetMapping(); | ||
} | ||
|
||
public ProjectType Map(Guid typeGuid) | ||
{ | ||
return _mapping.ContainsKey(typeGuid) | ||
? _mapping[typeGuid] | ||
: ProjectType.Unknown; | ||
} | ||
|
||
private static IDictionary<Guid, ProjectType> GetMapping() | ||
{ | ||
return new Dictionary<Guid, ProjectType> | ||
{ | ||
{new Guid("2150E333-8FDC-42A3-9474-1A3956D46DE8"), ProjectType.SolutionFolder}, | ||
{new Guid("FAE04EC0-301F-11D3-BF4B-00C04F79EFBC"), ProjectType.CSharpClassLibrary}, | ||
{new Guid("9A19103F-16F7-4668-BE54-9A1E7A4F7556"), ProjectType.CSharpClassLibrary} | ||
}; | ||
} | ||
} | ||
} |