Пример #1
0
        // Resolves a path with visual studio macros in it.
        public static string ResolveVisualStudioMacros(Project project, string path)
        {
            // Replace $(PlatformName) with the platform name.
            path = path.Replace("$(PlatformName)", ProjectUtility.GetActivePlatform(project));

            // Replace $(ConfigurationName) with the configuration name.
            path = path.Replace("$(ConfigurationName)", ProjectUtility.GetActiveConfiguration(project));

            // Replace $(ProjectName) with the project name.
            path = path.Replace("$(ProjectName)", ProjectUtility.GetProjectName(project));

            // Replace $(SolutionName) with the solution name.
            path = path.Replace("$(SolutionName)", ProjectUtility.GetSolutionName());

            // Replace $(ProjectDir) with the project directory.
            path = path.Replace("$(ProjectDir)", ProjectUtility.GetFullProjectPath(project));

            // Replace $(SolutionDir) with the solution directory.
            path = path.Replace("$(SolutionDir)", ProjectUtility.GetFullSolutionPath());

            //if we still have $() it should error really!

            return(path);
        }