anx.framework/Tools/XNAToANXConverter/VSSolutionProject.cs
SND\AstrorEnales_cp 5505f7dcbf - Added PlatformSystem Plugins layer
- Started Windows, Metro and Linux Platform-Plugins
- Moved the RecordingSample to the Samples folder
- Started two samples for using the graphics device in a WinForms and Wpf Editor
- Refactorings in the AddIn-System
- Moved the Window initialization-code to the Platform modules
- Changed the License text in all code files which is now way smaller
- Started ProjectConverter tool which converts all the projects and solution to the target configuration
- Changed the SupportedPlatform names in the Resource files
- Changed the WIN8 define to WINDOWSMETRO which is actually meant
- Removed NLog and started our own Logger class
- Many more stuff...
2012-08-09 09:45:04 +00:00

69 lines
1.8 KiB
C#

using System;
using System.Reflection;
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ProjectConverter
{
public class VSSolutionProject
{
private static readonly Type msBuildProjectType;
private static readonly PropertyInfo nameProperty;
private static readonly PropertyInfo relativePathProperty;
private static readonly PropertyInfo projectGuidProperty;
public string ProjectName
{
get;
private set;
}
public string RelativePath
{
get;
private set;
}
public string ProjectGuid
{
get;
private set;
}
public bool IsCsProject
{
get
{
return RelativePath.EndsWith(".csproj");
}
}
static VSSolutionProject()
{
msBuildProjectType = Type.GetType(
"Microsoft.Build.Construction.ProjectInSolution, " +
"Microsoft.Build, Version=4.0.0.0, Culture=neutral, " +
"PublicKeyToken=b03f5f7f11d50a3a", false, false);
if (msBuildProjectType != null)
{
nameProperty = msBuildProjectType.GetProperty(
"ProjectName", VSSolution.NonPublicInstanceFlag);
relativePathProperty = msBuildProjectType.GetProperty(
"RelativePath", VSSolution.NonPublicInstanceFlag);
projectGuidProperty = msBuildProjectType.GetProperty(
"ProjectGuid", VSSolution.NonPublicInstanceFlag);
}
}
public VSSolutionProject(object solutionProject)
{
ProjectName = nameProperty.GetValue(solutionProject, null) as string;
RelativePath = relativePathProperty.GetValue(solutionProject, null) as string;
ProjectGuid = projectGuidProperty.GetValue(solutionProject, null) as string;
}
}
}