本文整理汇总了C#中Microsoft.Build.Evaluation.GetProperty方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.Build.Evaluation.GetProperty方法的具体用法?C# Microsoft.Build.Evaluation.GetProperty怎么用?C# Microsoft.Build.Evaluation.GetProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Build.Evaluation
的用法示例。
在下文中一共展示了Microsoft.Build.Evaluation.GetProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MakeTemplateReplacements
static internal void MakeTemplateReplacements(bool isAProject, bool creatingProject,
string rootNamespace, string sourceFileName, _BE.Project proj)
{
if (isAProject)
{
if (!string.IsNullOrEmpty(rootNamespace))
{
_BE.ProjectProperty prop;
string name;
name = "StartupObject";
prop = proj.GetProperty(name);
if (prop != null) proj.SetProperty(name, prop.UnevaluatedValue.Replace(rootNamespace + ".", "$safeprojectname$."));
name = "DocumentationFile";
prop = proj.GetProperty(name);
if (prop != null) proj.SetProperty(name, prop.UnevaluatedValue.Replace(rootNamespace + ".", "$safeprojectname$."));
name = "RootNamespace";
prop = proj.GetProperty(name);
if (prop != null) proj.SetProperty(name, prop.UnevaluatedValue.Replace(rootNamespace, "$safeprojectname$"));
name = "AssemblyName";
prop = proj.GetProperty(name);
if (prop != null) proj.SetProperty(name, prop.UnevaluatedValue.Replace(rootNamespace, "$safeprojectname$"));
}
}
else
{
if (creatingProject == true)
{
//Exporting the entire project ... replace projectname only; this may not work as desired for Web projects,
//we don't have any so we don't care.
WordReplace(proj, rootNamespace, "$safeprojectname$");
}
else
{
//Exporting a single item from a project. Replace root name space (if given)
//and item name
if (!string.IsNullOrEmpty(rootNamespace))
{
WordReplace(proj, rootNamespace, "$rootnamespace$");
}
string itemName = Path.GetFileNameWithoutExtension(sourceFileName);
int iDotIndex = itemName.LastIndexOf(".");
if (iDotIndex != -1)
{
//This is intended to fix the foo.designer.vb case (GetFileNameWithoutExtension()
//returns foo.designer, and we want to replace just foo
itemName = itemName.Substring(0, iDotIndex);
}
WordReplace(proj, itemName, "$safeitemname$");
}
}
}